public class IlvXMLDataSource extends IlvDiagrammerDataSource
An XML data source implements the reading of data from an XML data file into a diagram component and the writing of data from a diagram component to an XML data file in conformance with the SDM XML format. The XML data source can also read and write custom XML formats. To do this, two XSL files must be provided: one for input (which transforms the custom XML format into the SDM format) and one for output (which transforms the SDM format into the custom format).
See IlvXMLConnector
for a description of
the data file format.
IlvXSLConnector
Constructor and Description |
---|
IlvXMLDataSource()
Creates a new
IlvXMLDataSource . |
Modifier and Type | Method and Description |
---|---|
void |
clearInputParameters()
Clears the parameters to pass to the input XSL transform.
|
void |
clearOutputParameters()
Clears the parameters to pass to the output XSL transform.
|
protected void |
deserializeImpl(Element element)
Deserializes the parameters of this data source from the specified DOM element.
|
protected IlvXMLConnector |
getConnector()
Returns the XML connector.
|
URL |
getDataURL()
Returns the URL of the XML data file.
|
String |
getDescription()
Returns the URL of the XML data file to which this XML data source points.
|
URL |
getInputXSL()
Returns the URL of the input XSL file.
|
URL |
getOutputXSL()
Returns the URL of the output XSL file.
|
void |
read(IlvDiagrammer diagrammer)
Reads the XML data file and sends it to the diagram component for rendering.
|
protected void |
serializeImpl(Element element)
Serializes the parameters of this data source to the specified DOM element.
|
void |
setDataURL(URL dataURL)
Sets the URL of the XML data file.
|
void |
setInputParameter(String name,
Object value)
Adds a parameter to pass to the input XSL transform.
|
void |
setInputXSL(URL inputXSL)
Sets the URL of the input XSL file.
|
void |
setOutputParameter(String name,
Object value)
Adds a parameter to pass to the output XSL transform.
|
void |
setOutputXSL(URL outputXSL)
Sets the URL of the output XSL file.
|
boolean |
supportsWrite()
Returns
true : XML data sources do support writing. |
void |
write(IlvDiagrammer diagrammer)
Writes the data from the diagram component to the XML data file.
|
deserialize, getBaseURL, serialize
public URL getDataURL()
public void setDataURL(URL dataURL)
dataURL
- URL of the data filepublic URL getInputXSL()
public void setInputXSL(URL inputXSL)
null
to read XML in the SDM format.inputXSL
- URL of the input XSL filepublic URL getOutputXSL()
public void setInputParameter(String name, Object value)
name
- The name of the parameter.value
- The value of the parameter.IlvXSLConnector.setInputParameter(java.lang.String, java.lang.Object)
public void clearInputParameters()
IlvXSLConnector.clearInputParameters()
public void setOutputParameter(String name, Object value)
name
- The name of the parameter.value
- The value of the parameter.IlvXSLConnector.setOutputParameter(java.lang.String, java.lang.Object)
public void clearOutputParameters()
IlvXSLConnector.clearOutputParameters()
public void setOutputXSL(URL outputXSL)
null
to write XML in the SDM format.outputXSL
- URL of the output XSL fileprotected IlvXMLConnector getConnector()
public void read(IlvDiagrammer diagrammer) throws IlvDiagrammerException
read
in class IlvDiagrammerDataSource
diagrammer
- The diagram component that will display the data read from this data source.IlvDiagrammerException
- If an exception occurs while reading data. This exception
will usually contain a "cause", that is, the original
low-level exception that caused the data source to
fail to complete the operation.public boolean supportsWrite()
true
: XML data sources do support writing.supportsWrite
in class IlvDiagrammerDataSource
public void write(IlvDiagrammer diagrammer) throws IlvDiagrammerException
write
in class IlvDiagrammerDataSource
diagrammer
- The diagram component that contains the data to be saved to the data source.IlvDiagrammerException
- If an exception occurs while writing data. This exception
will usually contain a "cause", that is to say the original
low-level exception that caused the data source to
fail to complete the operation.public String getDescription()
getDescription
in class IlvDiagrammerDataSource
protected void serializeImpl(Element element) throws IlvDiagrammerException
serializeImpl
in class IlvDiagrammerDataSource
element
- The DOM element to which the data source parameters are written.IlvDiagrammerException
- If an exception occurs while serializing the data source.protected void deserializeImpl(Element element) throws IlvDiagrammerException
deserializeImpl
in class IlvDiagrammerDataSource
element
- The DOM element to which the data source parameters are written.IlvDiagrammerException
- If an exception occurs while deserializing the data source.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.