ReportMill 11 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.lang.Cloneable

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


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.
 java.lang.Object 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.
 java.util.List getDataset(RMFetch aFetch)
          Gets the dataset for an entity.
 java.lang.String getError()
          Returns the last error encountered when loading a 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
close, createObject, getDataset, getEntity, getName, hasChanges, isReadOnly, setName
 
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.

Specified by:
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.

Specified by:
getDataset in class RMDataSource

getDataset

public java.util.List getDataset(RMFetch aFetch)
Gets the dataset for an entity.

Overrides:
getDataset in class RMDataSource

refresh

public void refresh()
Invalidates any cached data.

Overrides:
refresh in class RMDataSource

getError

public java.lang.String getError()
Returns the last error encountered when loading a datasource.

Overrides:
getError 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 java.lang.Object 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 11 API