Class XMLBeans
java.lang.Object
weka.core.xml.XMLSerialization
weka.core.xml.XMLBasicSerialization
weka.gui.beans.xml.XMLBeans
- All Implemented Interfaces:
RevisionHandler
This class serializes and deserializes a KnowledgeFlow setup to and fro XML.
- Version:
- $Revision: 7411 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intthe data that is about to be read/written contains a complete layoutstatic final intthe data that is about to be read/written contains user-components, i.e., Metabeansstatic final intthe index in the Vector, where the BeanConnections are stored (Instances and Connections are stored in a Vector and then serialized)static final intthe index in the Vector, where the BeanInstances are stored (Instances and Connections are stored in a Vector and then serialized)static final Stringthe value of the animatedIconPath propertystatic final Stringthe value of the associatedConnections propertystatic final Stringthe value of the bean propertystatic final Stringthe value of the beanContext propertystatic final Stringthe value of the blue propertystatic final Stringthe value of the color propertystatic final Stringthe value of the customName propertystatic final Stringthe value of the dir propertystatic final Stringthe value of the eventname propertystatic final Stringthe value of the file propertystatic final Stringthe value of the font propertystatic final Stringthe value of the green propertystatic final Stringthe value of the height propertystatic final Stringthe value of the hidden propertystatic final Stringthe value of the iconpath propertystatic final Stringthe value of the id propertystatic final Stringthe value of the input propertystatic final Stringthe value of the input id propertystatic final Stringthe value of the loader propertystatic final Stringthe value of the location propertystatic final Stringthe value of the value propertystatic final Stringthe value of the options propertystatic final Stringthe value of the originalCoords propertystatic final Stringthe value of the outputs id propertystatic final Stringthe value of the outputs propertystatic final Stringthe value of the prefix propertystatic final Stringthe value of the red propertystatic final Stringthe value of the relationNameForFilename property (Saver)static final Stringstatic final Stringthe value of the saver propertystatic final Stringthe value of the size propertystatic final Stringthe value of the source propertystatic final Stringthe value of the style propertystatic final Stringthe value of the subFlow propertystatic final Stringthe value of the target propertystatic final Stringthe value of the text propertystatic final Stringthe value of the width propertystatic final Stringthe value of the x propertystatic final Stringthe value of the y propertyFields inherited from class XMLBasicSerialization
VAL_CELLS, VAL_KEY, VAL_MAPPING, VAL_VALUEFields inherited from class XMLSerialization
ATT_ARRAY, ATT_ARRAY_DEFAULT, ATT_CLASS, ATT_NAME, ATT_NULL, ATT_NULL_DEFAULT, ATT_PRIMITIVE, ATT_PRIMITIVE_DEFAULT, ATT_VERSION, DOCTYPE, ROOT_NODE, TAG_OBJECT, VAL_NO, VAL_ROOT, VAL_YES -
Constructor Summary
ConstructorsConstructorDescriptionXMLBeans(JComponent layout, BeanContextSupport context) initializes the serialization for layoutsXMLBeans(JComponent layout, BeanContextSupport context, int datatype) initializes the serialization for different types of data -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methodsintreturns the type of data that is to be read/writtenreadBeanConnection(Element node) builds the BeanConnection from the given DOM node.readBeanInstance(Element node) builds the BeanInstance from the given DOM node.readBeanVisual(Element node) builds the BeanVisual from the given DOM node.builds the Color from the given DOM node.readColorUIResource(Element node) builds the ColorUIResource from the given DOM node.readDimension(Element node) builds the Dimension from the given DOM node.builds the Font from the given DOM node.readFontUIResource(Element node) builds the FontUIResource from the given DOM node.readLoader(Element node) builds the Loader from the given DOM node.readMetaBean(Element node) builds the MetaBean from the given DOM node.builds the Point from the given DOM node.builds the Saver from the given DOM node.voidsetDataType(int value) sets what kind of data is to be read/writtenwriteBeanConnection(Element parent, Object o, String name) adds the given BeanConncetion to a DOM structure.writeBeanInstance(Element parent, Object o, String name) adds the given BeanInstance to a DOM structure.writeBeanLoader(Element parent, Object o, String name) adds the given Loader (a bean) to a DOM structure.writeBeanSaver(Element parent, Object o, String name) adds the given Saver (a bean) to a DOM structure.writeBeanVisual(Element parent, Object o, String name) adds the given BeanVisual to a DOM structure.writeColor(Element parent, Object o, String name) adds the given Color to a DOM structure.writeColorUIResource(Element parent, Object o, String name) adds the given ColorUIResource to a DOM structure.writeDimension(Element parent, Object o, String name) adds the given Dimension to a DOM structure.adds the given Font to a DOM structure.writeFontUIResource(Element parent, Object o, String name) adds the given FontUIResource to a DOM structure.writeLoader(Element parent, Object o, String name) adds the given Loader to a DOM structure.writeMetaBean(Element parent, Object o, String name) adds the given MetaBean to a DOM structure.writePoint(Element parent, Object o, String name) adds the given Point to a DOM structure.writeSaver(Element parent, Object o, String name) adds the given Saver to a DOM structure.Methods inherited from class XMLBasicSerialization
getRevision, readCollection, readCostMatrixOld, readDefaultListModel, readMap, readMatrix, readMatrixOld, writeCollection, writeCostMatrixOld, writeDefaultListModel, writeMap, writeMatrix, writeMatrixOldMethods inherited from class XMLSerialization
fromXML, getVersion, main, read, read, read, read, readBooleanFromXML, readByteFromXML, readCharFromXML, readDoubleFromXML, readFloatFromXML, readFromXML, readFromXML, readIntFromXML, readLongFromXML, readShortFromXML, toXML, write, write, write, write, writeToXML
-
Field Details
-
VAL_ID
-
VAL_X
-
VAL_Y
-
VAL_BEAN
-
VAL_CUSTOM_NAME
-
VAL_SOURCEID
-
VAL_TARGETID
-
VAL_EVENTNAME
-
VAL_HIDDEN
-
VAL_FILE
-
VAL_DIR
-
VAL_PREFIX
-
VAL_RELATIVE_PATH
- See Also:
-
VAL_OPTIONS
-
VAL_SAVER
-
VAL_LOADER
-
VAL_TEXT
-
VAL_BEANCONTEXT
-
VAL_WIDTH
-
VAL_HEIGHT
-
VAL_RED
-
VAL_GREEN
-
VAL_BLUE
-
VAL_NAME
-
VAL_STYLE
-
VAL_LOCATION
-
VAL_SIZE
-
VAL_COLOR
-
VAL_FONT
-
VAL_ICONPATH
-
VAL_ANIMATEDICONPATH
the value of the animatedIconPath property- See Also:
-
VAL_ASSOCIATEDCONNECTIONS
the value of the associatedConnections property- See Also:
-
VAL_INPUTS
-
VAL_INPUTSID
-
VAL_OUTPUTS
-
VAL_OUTPUTSID
-
VAL_SUBFLOW
-
VAL_ORIGINALCOORDS
-
VAL_RELATIONNAMEFORFILENAME
the value of the relationNameForFilename property (Saver)- See Also:
-
INDEX_BEANINSTANCES
public static final int INDEX_BEANINSTANCESthe index in the Vector, where the BeanInstances are stored (Instances and Connections are stored in a Vector and then serialized)- See Also:
-
INDEX_BEANCONNECTIONS
public static final int INDEX_BEANCONNECTIONSthe index in the Vector, where the BeanConnections are stored (Instances and Connections are stored in a Vector and then serialized)- See Also:
-
DATATYPE_LAYOUT
public static final int DATATYPE_LAYOUTthe data that is about to be read/written contains a complete layout- See Also:
-
DATATYPE_USERCOMPONENTS
public static final int DATATYPE_USERCOMPONENTSthe data that is about to be read/written contains user-components, i.e., Metabeans- See Also:
-
-
Constructor Details
-
XMLBeans
initializes the serialization for layouts- Parameters:
layout- the component that manages the layoutcontext- the bean context support to use- Throws:
Exception- if initialization fails
-
XMLBeans
initializes the serialization for different types of data- Parameters:
layout- the component that manages the layoutcontext- the bean context support to usedatatype- the type of data to read/write- Throws:
Exception- if initialization fails
-
-
Method Details
-
setDataType
public void setDataType(int value) sets what kind of data is to be read/written- Parameters:
value- the type of data- See Also:
-
getDataType
public int getDataType()returns the type of data that is to be read/written- Returns:
- the type of data
- See Also:
-
clear
generates internally a new XML document and clears also the IgnoreList and the mappings for the Read/Write-Methods- Overrides:
clearin classXMLBasicSerialization- Throws:
Exception- if something goes wrong
-
writeColor
adds the given Color to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readColor
-
writeDimension
adds the given Dimension to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readDimension
-
writeFont
adds the given Font to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readFont
-
writePoint
adds the given Point to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readPoint
-
writeColorUIResource
adds the given ColorUIResource to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readColorUIResource
-
writeFontUIResource
adds the given FontUIResource to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readFontUIResource
-
writeBeanInstance
adds the given BeanInstance to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readBeanInstance
-
writeBeanConnection
adds the given BeanConncetion to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readBeanConnection
-
writeBeanLoader
adds the given Loader (a bean) to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
writeBeanSaver
adds the given Saver (a bean) to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
writeLoader
adds the given Loader to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readLoader
-
writeSaver
adds the given Saver to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readSaver
-
writeBeanVisual
adds the given BeanVisual to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readBeanVisual
-
writeMetaBean
adds the given MetaBean to a DOM structure.- Parameters:
parent- the parent of this object, e.g. the class this object is a member ofo- the Object to describe in XMLname- the name of the object- Returns:
- the node that was created
- Throws:
Exception- if the DOM creation fails
-
readMetaBean
-