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 Details

    • RMDataSourceXML

      public RMDataSourceXML()
      Creates a plain datasource.
    • RMDataSourceXML

      public RMDataSourceXML(Object aSource, String aName)
      Creates a datasource from a given source with a given name (can be null).
  • Method Details

    • getSource

      public Object getSource()
      Returns the source for the datasource.
    • setSource

      public void setSource(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 class RMDataSource
    • 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(String aKeyPath)
      Returns the entity at the given key path.
      Overrides:
      getEntity in class RMDataSource
    • getRelation

      public RMProperty getRelation(String aKeyPath)
      Returns the relation at the given key path.
      Overrides:
      getRelation in class RMDataSource
    • getDataset

      public Map getDataset()
      Returns a sample dataset of objects associated with the datasource.
      Overrides:
      getDataset in class RMDataSource
    • getError

      public String getError()
      Returns the last error encountered when loading a datasource.
      Overrides:
      getError in class RMDataSource
    • setSourceContext

      public static void setSourceContext(Object aSource)
      Sets possible context for aSource.
    • toString

      public String toString()
      Returns a string representation of the datasource (just its name).
      Overrides:
      toString in class RMDataSource
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Overrides:
      toXML in class RMDataSource
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Overrides:
      fromXML in class RMDataSource
    • initWithArchiver

      public Object initWithArchiver(RMArchiver anArchiver)
      Legacy unarchival.