ReportMill 12 API

com.reportmill.datasource
Class RMXMLDataSource

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.datasource.RMDataSource
          extended by com.reportmill.datasource.RMXMLDataSource
All Implemented Interfaces:
com.reportmill.base.RMPropertyChanger, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

public class RMXMLDataSource
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).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.reportmill.datasource.RMDataSource
RMDataSource.EntityResolver
 
Constructor Summary
RMXMLDataSource()
          Creates a plain datasource.
RMXMLDataSource(java.lang.Object aSource, java.lang.String aName)
          Creates a datasource from a given source with a given name (can be null).
 
Method Summary
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 RMXMLDataSource fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          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.
 RMSchema getSchema()
          Returns the schema of represented datasource as a hierarchy of RMEntity and RMProperty objects.
 java.lang.Object getSource()
          Returns the source for the datasource.
 void refresh()
          Invalidates any cached data.
 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.
 java.lang.String toString()
          Returns a string representation of the datasource (just its name).
 com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
          XML archival.
 
Methods inherited from class com.reportmill.datasource.RMDataSource
create, createEntity, createObject, delete, deleteEntity, deleteFile, deleteRow, getAllRows, getDataset, getEntity, getEntityClass, getEntityResolver, getFile, getFile, getFile, getFilesImpl, getName, getRootDirectory, getRow, getRow, getRows, getSchemaVisible, getTypeString, getUniqueRow, insertRow, propertyChange, readFile, saveRows, saveRowsImmediately, setEntityResolver, setName, updateRow, writeFile
 
Methods inherited from class com.reportmill.base.RMObject
addListener, addPropertyChangeListener, animUpdate, clone, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RMXMLDataSource

public RMXMLDataSource()
Creates a plain datasource.


RMXMLDataSource

public RMXMLDataSource(java.lang.Object aSource,
                       java.lang.String aName)
Creates a datasource from a given source with a given name (can be null).

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 hierarchy 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.


getDataset

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

Overrides:
getDataset in class RMDataSource

refresh

public void refresh()
Invalidates any cached data.

Overrides:
refresh in class RMDataSource

equals

public boolean equals(java.lang.Object anObj)
Standard equals implementation.

Overrides:
equals in class RMDataSource

toXML

public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver,
                                               java.lang.Object anOwner)
XML archival.

Overrides:
toXML in class RMDataSource

fromXML

public RMXMLDataSource fromXML(com.reportmill.archiver.RXArchiver anArchiver,
                               com.reportmill.archiver.RXElement anElement,
                               java.lang.Object anOwner)
XML unarchival.

Overrides:
fromXML in class RMDataSource

toString

public java.lang.String toString()
Returns a string representation of the datasource (just its name).

Overrides:
toString in class RMDataSource

ReportMill 12 API