Class RMDataSource

  • All Implemented Interfaces:
    Archivable
    Direct Known Subclasses:
    SampleDataSchema

    public class RMDataSource
    extends java.lang.Object
    implements Archivable
    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 Schema, Entity and Property objects) and it provides sample data (mostly in the form of Java Collections and core types: List, Map, String, Number, Date).
    • Constructor Summary

      Constructors 
      Constructor Description
      RMDataSource()
      Creates a plain datasource.
      RMDataSource​(WebURL aURL)
      Creates a datasource from a given source with a given name (can be null).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Map createDataset()
      Returns a sample dataset of objects associated with the datasource.
      protected Schema createSchema()
      Creates the schema.
      RMDataSource 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.
      java.lang.String getName()
      Returns the name for this data source.
      Schema getSchema()
      Returns the schema of represented datasource as a hierarchy of Entity and Property objects.
      void setCustomSchema​(boolean customSchema)
      Sets a schema that may differ from the one stored in an XML file.
      java.lang.String toString()
      Returns a string representation of the datasource (just its name).
      RXElement toXML​(RXArchiver anArchiver)
      XML archival.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RMDataSource

        public RMDataSource()
        Creates a plain datasource.
      • RMDataSource

        public RMDataSource​(WebURL aURL)
        Creates a datasource from a given source with a given name (can be null).
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name for this data source.
      • getSchema

        public Schema getSchema()
        Returns the schema of represented datasource as a hierarchy of Entity and Property objects.
      • createSchema

        protected Schema createSchema()
        Creates the schema.
      • getDataset

        public java.util.Map getDataset()
        Returns a sample dataset of objects associated with the datasource.
      • createDataset

        protected java.util.Map createDataset()
        Returns a sample dataset of objects associated with the datasource.
      • 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.
      • toString

        public java.lang.String toString()
        Returns a string representation of the datasource (just its name).
        Overrides:
        toString in class java.lang.Object