Package com.ribs.datasource
Class RMDataSourceXML
- java.lang.Object
-
- com.ribs.datasource.RMDataSource
-
- com.ribs.datasource.RMDataSourceXML
-
public class RMDataSourceXML extends RMDataSource
This class is used as a proxy for objects passed to document's generateReport() method. It provides schema information of the object graph (in the form of RMEntity and RMProperty objects) and it provides sample data (probably in the form of Java Collections and core types: List, Map, String, Number, Date).
-
-
Constructor Summary
Constructors Constructor Description RMDataSourceXML()
Creates a plain datasource.RMDataSourceXML(java.lang.Object aSource, java.lang.String aName)
Creates a datasource from a given source with a given name (can be null).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.boolean
getCustomSchema()
Returns a schema that may differ from the one stored in an XML file.java.util.Map
getDataset()
Returns a sample dataset of objects associated with the datasource.RMEntity
getEntity(java.lang.String aKeyPath)
Returns the entity at the given key path.java.lang.String
getError()
Returns the last error encountered when loading a datasource.RMProperty
getRelation(java.lang.String aKeyPath)
Returns the relation at the given key path.RMSchema
getSchema()
Returns the schema of represented datasource as a heirarchy of RMEntity and RMProperty objects.java.lang.Object
getSource()
Returns the source for the datasource.java.lang.Object
initWithArchiver(RMArchiver anArchiver)
Legacy unarchival.void
setCustomSchema(boolean customSchema)
Sets a schema that may differ from the one stored in an XML file.void
setSource(java.lang.Object aSource)
Sets the source for the datasource.static void
setSourceContext(java.lang.Object aSource)
Sets possible context for aSource.java.lang.String
toString()
Returns a string representation of the datasource (just its name).RXElement
toXML(RXArchiver anArchiver)
XML archival.-
Methods inherited from class com.ribs.datasource.RMDataSource
getName, setName
-
-
-
-
Method Detail
-
getSource
public java.lang.Object getSource()
Returns the source for the datasource.
-
setSource
public void setSource(java.lang.Object aSource)
Sets the source for the datasource.
-
getSchema
public RMSchema getSchema()
Returns the schema of represented datasource as a heirarchy of RMEntity and RMProperty objects.- Overrides:
getSchema
in classRMDataSource
-
getCustomSchema
public boolean getCustomSchema()
Returns a schema that may differ from the one stored in an XML file.
-
setCustomSchema
public void setCustomSchema(boolean customSchema)
Sets a schema that may differ from the one stored in an XML file.
-
getEntity
public RMEntity getEntity(java.lang.String aKeyPath)
Returns the entity at the given key path.- Overrides:
getEntity
in classRMDataSource
-
getRelation
public RMProperty getRelation(java.lang.String aKeyPath)
Returns the relation at the given key path.- Overrides:
getRelation
in classRMDataSource
-
getDataset
public java.util.Map getDataset()
Returns a sample dataset of objects associated with the datasource.- Overrides:
getDataset
in classRMDataSource
-
getError
public java.lang.String getError()
Returns the last error encountered when loading a datasource.- Overrides:
getError
in classRMDataSource
-
setSourceContext
public static void setSourceContext(java.lang.Object aSource)
Sets possible context for aSource.
-
toString
public java.lang.String toString()
Returns a string representation of the datasource (just its name).- Overrides:
toString
in classRMDataSource
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.- Overrides:
toXML
in classRMDataSource
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Overrides:
fromXML
in classRMDataSource
-
initWithArchiver
public java.lang.Object initWithArchiver(RMArchiver anArchiver)
Legacy unarchival.
-
-