Package com.inductiveautomation.rm.base
Class RMXMLWriter
- java.lang.Object
- 
- com.inductiveautomation.rm.base.RMXMLWriter
 
- 
 public class RMXMLWriter extends java.lang.ObjectThis 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 SummaryFields Modifier and Type Field Description static java.lang.StringTAG_ID
 - 
Constructor SummaryConstructors Constructor Description RMXMLWriter()Creates a new xml writer.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RMSchemaMakercreateSchemaMaker()Creates a new schema maker.booleangetIncludeFields()Returns whether to include fields.intgetPropertyNextUniqueID(Property aProperty)Returns the next unique id for given property.SchemagetSchema()Returns the schema.RMSchemaMakergetSchemaMaker()Returns the schema maker.booleangetUseGetAndIsMethodsOnly()Returns whether to only use getX/isX accessor methods (as opposed to any method returning a value).RXElementgetXML(java.lang.Object anObj, Schema aSchema, int aDegreeOfSeparation)Returns an element tree for given collections map and schema.RXElementgetXML(java.lang.Object anObj, java.lang.Object userInfo, int degreeOfSeparation)Returns an xml RXElement tree for given Java dataset and optional userInfo, out to given degree of separation.voidignoreClass(java.lang.Class aClass)Tells writer to ignore any member of the given class from the serialized object graph.voidignoreClass(java.lang.String aClassName)Tells writer to ignore any member of the given class name from the serialized object graph.voidignoreMember(java.lang.Class aClass, java.lang.String aName)Tells writer to ignore any member with the given class - member combination.voidignoreMember(java.lang.String aFieldName)Tells writer to ignore any member with the given method/field name from the serialized object graph.voidignoreMember(java.lang.String aClassName, java.lang.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(java.lang.Object anObj, java.lang.Object userInfo, java.lang.String aPath, int degreeOfSeparation)Writes given Java dataset and optional userInfo to given path as XML, out to given degree of separation.voidwriteObject(java.lang.Object anObj, java.lang.String aPath)Writes given Java dataset to given path as XML, out to three levels deep, which is default degree of separation.voidwriteObject(java.lang.Object anObj, java.lang.String aPath, int dos)Writes given Java dataset to given path as XML, out to given degree of separation.
 
- 
- 
- 
Field Detail- 
TAG_IDpublic static final java.lang.String TAG_ID - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getSchemaMakerpublic RMSchemaMaker getSchemaMaker() Returns the schema maker.
 - 
createSchemaMakerprotected RMSchemaMaker createSchemaMaker() Creates a new schema maker.
 - 
getUseGetAndIsMethodsOnlypublic boolean getUseGetAndIsMethodsOnly() Returns whether to only use getX/isX accessor methods (as opposed to any method returning a value).
 - 
setUseGetAndIsMethodsOnlypublic void setUseGetAndIsMethodsOnly(boolean aFlag) Sets whether to only use getX/isX accessor methods (as opposed to any method returning a value).
 - 
getIncludeFieldspublic boolean getIncludeFields() Returns whether to include fields.
 - 
setIncludeFieldspublic void setIncludeFields(boolean aFlag) Sets whether to include fields.
 - 
ignoreClasspublic void ignoreClass(java.lang.Class aClass) Tells writer to ignore any member of the given class from the serialized object graph.
 - 
ignoreClasspublic void ignoreClass(java.lang.String aClassName) Tells writer to ignore any member of the given class name from the serialized object graph.
 - 
ignoreMemberpublic void ignoreMember(java.lang.String aFieldName) Tells writer to ignore any member with the given method/field name from the serialized object graph.
 - 
ignoreMemberpublic void ignoreMember(java.lang.Class aClass, java.lang.String aName)Tells writer to ignore any member with the given class - member combination.
 - 
ignoreMemberpublic void ignoreMember(java.lang.String aClassName, java.lang.String aName)Tells writer to ignore any member with the given classname - member combination.
 - 
writeObjectpublic void writeObject(java.lang.Object anObj, java.lang.String aPath)Writes given Java dataset to given path as XML, out to three levels deep, which is default degree of separation.
 - 
writeObjectpublic void writeObject(java.lang.Object anObj, java.lang.String aPath, int dos)Writes given Java dataset to given path as XML, out to given degree of separation.
 - 
writeObjectpublic void writeObject(java.lang.Object anObj, java.lang.Object userInfo, java.lang.String aPath, int degreeOfSeparation)Writes given Java dataset and optional userInfo to given path as XML, out to given degree of separation.
 - 
getXMLpublic RXElement getXML(java.lang.Object anObj, java.lang.Object userInfo, int degreeOfSeparation) Returns an xml RXElement tree for given Java dataset and optional userInfo, out to given degree of separation.
 - 
getXMLpublic RXElement getXML(java.lang.Object anObj, Schema aSchema, int aDegreeOfSeparation) Returns an element tree for given collections map and schema.
 - 
getSchemapublic Schema getSchema() Returns the schema.
 - 
getPropertyNextUniqueIDpublic int getPropertyNextUniqueID(Property aProperty) Returns the next unique id for given property.
 
- 
 
-