Package com.inductiveautomation.rm.base
Class RMXMLWriter
java.lang.Object
com.inductiveautomation.rm.base.RMXMLWriter
This class turns any Java dataset into XML. The most common use of this class is simply the writeObject()
method, which takes a Java dataset and results in a very clean XML description (at the given path):
new RMXMLWriter().writeObject(myObjects, "MyDataset.xml");
The Java dataset can take almost any form: a list, map or hierarchy of EJBs, custom Java classes, Java collections classes or even JDBC ResultSets. The resulting XML file is a very clean description of all the public fields, methods and keys/values in the dataset (out to three levels deep, which is the default "degree of separation").
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RMSchemaMakerCreates a new schema maker.booleanReturns whether to include fields.intgetPropertyNextUniqueID(Property aProperty) Returns the next unique id for given property.Returns the schema.Returns the schema maker.booleanReturns whether to only use getX/isX accessor methods (as opposed to any method returning a value).Returns an element tree for given collections map and schema.Returns an xml RXElement tree for given Java dataset and optional userInfo, out to given degree of separation.voidignoreClass(Class aClass) Tells writer to ignore any member of the given class from the serialized object graph.voidignoreClass(String aClassName) Tells writer to ignore any member of the given class name from the serialized object graph.voidignoreMember(Class aClass, String aName) Tells writer to ignore any member with the given class - member combination.voidignoreMember(String aFieldName) Tells writer to ignore any member with the given method/field name from the serialized object graph.voidignoreMember(String aClassName, String aName) Tells writer to ignore any member with the given classname - member combination.voidsetIncludeFields(boolean aFlag) Sets whether to include fields.voidsetUseGetAndIsMethodsOnly(boolean aFlag) Sets whether to only use getX/isX accessor methods (as opposed to any method returning a value).voidwriteObject(Object anObj, Object userInfo, String aPath, int degreeOfSeparation) Writes given Java dataset and optional userInfo to given path as XML, out to given degree of separation.voidwriteObject(Object anObj, String aPath) Writes given Java dataset to given path as XML, out to three levels deep, which is default degree of separation.voidwriteObject(Object anObj, String aPath, int dos) Writes given Java dataset to given path as XML, out to given degree of separation.
-
Field Details
-
TAG_ID
- See Also:
-
-
Constructor Details
-
RMXMLWriter
public RMXMLWriter()Creates a new xml writer.
-
-
Method Details
-
getSchemaMaker
Returns the schema maker. -
createSchemaMaker
Creates a new schema maker. -
getUseGetAndIsMethodsOnly
public boolean getUseGetAndIsMethodsOnly()Returns whether to only use getX/isX accessor methods (as opposed to any method returning a value). -
setUseGetAndIsMethodsOnly
public void setUseGetAndIsMethodsOnly(boolean aFlag) Sets whether to only use getX/isX accessor methods (as opposed to any method returning a value). -
getIncludeFields
public boolean getIncludeFields()Returns whether to include fields. -
setIncludeFields
public void setIncludeFields(boolean aFlag) Sets whether to include fields. -
ignoreClass
Tells writer to ignore any member of the given class from the serialized object graph. -
ignoreClass
Tells writer to ignore any member of the given class name from the serialized object graph. -
ignoreMember
Tells writer to ignore any member with the given method/field name from the serialized object graph. -
ignoreMember
Tells writer to ignore any member with the given class - member combination. -
ignoreMember
Tells writer to ignore any member with the given classname - member combination. -
writeObject
Writes given Java dataset to given path as XML, out to three levels deep, which is default degree of separation. -
writeObject
Writes given Java dataset to given path as XML, out to given degree of separation. -
writeObject
Writes given Java dataset and optional userInfo to given path as XML, out to given degree of separation. -
getXML
Returns an xml RXElement tree for given Java dataset and optional userInfo, out to given degree of separation. -
getXML
Returns an element tree for given collections map and schema. -
getSchema
Returns the schema. -
getPropertyNextUniqueID
Returns the next unique id for given property.
-