|
|||||||||
| Home >> All >> jbreport >> [ core overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
jbreport.core
Class RepositoryImpl

java.lang.Objectjbreport.core.AbstractReportElement
jbreport.core.ReportCompositeImpl
jbreport.core.RepositoryImpl
- All Implemented Interfaces:
- java.lang.Cloneable, jbreport.ReportComposite, jbreport.ReportElement, jbreport.Repository, Traversable, XMLAware
- public class RepositoryImpl
- extends ReportCompositeImpl
- implements jbreport.Repository
- extends ReportCompositeImpl
This represents a storage area for a bunch of other element types, including but not limited to, datasources, queries, documents, etc.
As many repositories are allowed, this class provides methods to search
for repositories. It should be noted that a repository forms its' own
namespace, and that elements such as queries can be obtained by referring
to a given namespace. ie. should a Query x be required from Repository y,
we can either get Repository y, and then call getQuery("x") on
it, or if we already have a Repository z, then the call
getQuery("y.x") will return the same Query element.
- Version:
- $Revision: 1.1 $
| Field Summary | |
private static java.lang.String |
DATASOURCES
Used as a key into the namedTypes map for the named datasources |
private static java.lang.String |
DOCUMENTS
Used as a key into the namedTypes map for the named documents |
private static java.lang.String |
FRAGMENTS
Used as a key into the namedTypes map for the named fragments |
private java.util.Map |
namedTypes
This provides a map which contains other maps. |
private static java.lang.String |
QUERIES
Used as a key into the namedTypes map for the named queries |
private static java.util.Map |
repositories
The repositories that have been defined |
private static java.lang.String |
STYLESHEETS
Used as a key into the namedTypes map for the named stylesheets |
| Fields inherited from class jbreport.core.ReportCompositeImpl |
|
| Fields inherited from class jbreport.core.AbstractReportElement |
attrType, cdata, className, elementType, factory, name, xmlHandler |
| Fields inherited from interface jbreport.ReportElement |
DEEP, SHALLOW |
| Constructor Summary | |
RepositoryImpl()
|
|
| Method Summary | |
void |
accept(ReportVisitor visitor,
ReportVisitorState state)
This defines the operation that the Traversable instance must perform at each node in the traversal. |
java.util.Iterator |
documentNames()
Returns an iterator over the available document names within this repository, although the caller should check the iterator.hasNext
() method is not false on return. |
static boolean |
exists(java.lang.String name)
|
jbreport.data.Datasource |
fetchDatasource(java.lang.String name)
|
jbreport.ReportSection |
fetchDocument(java.lang.String name)
Returns the document for the given name, if one exists. |
jbreport.ReportElement |
fetchFragment(java.lang.String name)
Returns the fragment for the given name, if one exists. |
private jbreport.ReportElement |
fetchNamedElement(java.lang.String name,
java.lang.String map,
java.lang.Class cls)
|
jbreport.data.Query |
fetchQuery(java.lang.String name)
|
static jbreport.Repository |
fetchRepository(java.lang.String name)
|
jbreport.ReportStylesheet |
fetchStylesheet(java.lang.String name)
Returns the stylesheet for the given name, if one exists. |
private void |
insertNamedElement(jbreport.ReportElement elem,
java.lang.String map)
|
void |
xmlEndChild(jbreport.ReportElement elem)
This method is called for every child element that is defined during xml tree traversal. |
void |
xmlInitialize(java.lang.String localName,
org.xml.sax.Attributes attributes)
This should initialize the instance with data obtained during the traversal of an xml tree. |
| Methods inherited from class jbreport.core.ReportCompositeImpl |
addElement, clearElements, copy, getList, loadData, updateData |
| Methods inherited from class jbreport.core.AbstractReportElement |
assert, assertNotNull, boundParameters, breakEventNotify, clone, copy, getBoundParamValue, getElement, getFactory, getName, getParent, getRepository, getString, getStylesheet, getType, inOrderIterator, inOrderTraverse, postOrderIterator, postOrderTraverse, preLoadData, preOrderIterator, preOrderTraverse, setParent, setString, xmlEnd |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jbreport.ReportComposite |
addElement |
| Methods inherited from interface jbreport.ReportElement |
boundParameters, copy, copy, getBoundParamValue, getElement, getFactory, getList, getName, getParent, getRepository, getString, getStylesheet, getType, loadData, setParent, setString, xmlEnd |
| Field Detail |
QUERIES
private static final java.lang.String QUERIES
- Used as a key into the namedTypes map for the named queries
- See Also:
- Constant Field Values
DATASOURCES
private static final java.lang.String DATASOURCES
- Used as a key into the namedTypes map for the named datasources
- See Also:
- Constant Field Values
DOCUMENTS
private static final java.lang.String DOCUMENTS
- Used as a key into the namedTypes map for the named documents
- See Also:
- Constant Field Values
FRAGMENTS
private static final java.lang.String FRAGMENTS
- Used as a key into the namedTypes map for the named fragments
- See Also:
- Constant Field Values
STYLESHEETS
private static final java.lang.String STYLESHEETS
- Used as a key into the namedTypes map for the named stylesheets
- See Also:
- Constant Field Values
repositories
private static java.util.Map repositories
- The repositories that have been defined
namedTypes
private java.util.Map namedTypes
- This provides a map which contains other maps. This map is keyed by
contained map type, while the contained maps are keyed by name. ie.
(map type, (name, [query|datasource|document])).
| Constructor Detail |
RepositoryImpl
public RepositoryImpl()
| Method Detail |
fetchRepository
public static jbreport.Repository fetchRepository(java.lang.String name) throws jbreport.ReportException
exists
public static boolean exists(java.lang.String name)
fetchQuery
public jbreport.data.Query fetchQuery(java.lang.String name) throws jbreport.ReportException
fetchDatasource
public jbreport.data.Datasource fetchDatasource(java.lang.String name) throws jbreport.ReportException
fetchDocument
public jbreport.ReportSection fetchDocument(java.lang.String name) throws jbreport.ReportException
- Description copied from interface:
jbreport.Repository - Returns the document for the given name, if one exists. The name can
be in a different namespace, in which case the appropriate lookup will
be performed by the framework.
- Specified by:
fetchDocumentin interfacejbreport.Repository
documentNames
public java.util.Iterator documentNames()
- Description copied from interface:
jbreport.Repository - Returns an iterator over the available document names within this
repository, although the caller should check the
iterator.hasNext ()method is not false on return. This would indicate that there are no defined documents in this repository.The iterator returned does not support the
remove()method.- Specified by:
documentNamesin interfacejbreport.Repository
fetchFragment
public jbreport.ReportElement fetchFragment(java.lang.String name) throws jbreport.ReportException
- Description copied from interface:
jbreport.Repository - Returns the fragment for the given name, if one exists. The name can
be in a different namespace, in which case the appropriate lookup will
be performed by the framework.
- Specified by:
fetchFragmentin interfacejbreport.Repository
fetchStylesheet
public jbreport.ReportStylesheet fetchStylesheet(java.lang.String name) throws jbreport.ReportException
- Description copied from interface:
jbreport.Repository - Returns the stylesheet for the given name, if one exists. The name can
be in a different namespace, in which case the appropriate lookup will
be performed by the framework.
- Specified by:
fetchStylesheetin interfacejbreport.Repository
xmlInitialize
public void xmlInitialize(java.lang.String localName, org.xml.sax.Attributes attributes) throws jbreport.ReportException
- Description copied from interface:
jbreport.ReportElement - This should initialize the instance with data obtained during the
traversal of an xml tree. The child-parent relationship is catered for
with the
xmlEndChild()method.- Specified by:
xmlInitializein interfacejbreport.ReportElement- Overrides:
xmlInitializein classAbstractReportElement
xmlEndChild
public void xmlEndChild(jbreport.ReportElement elem) throws jbreport.ReportException
- Description copied from interface:
jbreport.ReportElement - This method is called for every child element that is defined during
xml tree traversal. In order to preserve the tree, it will only be
called at the end of the child definition.
- Specified by:
xmlEndChildin interfacejbreport.ReportElement- Overrides:
xmlEndChildin classReportCompositeImpl
accept
public void accept(ReportVisitor visitor, ReportVisitorState state) throws jbreport.ReportException
- Description copied from interface:
Traversable - This defines the operation that the Traversable instance must perform
at each node in the traversal. It should be coded such that it calls
an appropriate method on the ReportVisitor instance. Should an
appropriate method not exist, one should be coded.
The accept method should not recurse into its children, it is the contract of the iterator to perform that function.
eg:- For node type
Sectionthe method on this node should be as follows.public void accept(ReportVisitor visitor, ReportVisitorState state) throws ReportException { visitor.visitSection(this, state); }- Specified by:
acceptin interfaceTraversable- Overrides:
acceptin classReportCompositeImpl
fetchNamedElement
private jbreport.ReportElement fetchNamedElement(java.lang.String name, java.lang.String map, java.lang.Class cls) throws jbreport.ReportException
insertNamedElement
private void insertNamedElement(jbreport.ReportElement elem, java.lang.String map)
|
|||||||||
| Home >> All >> jbreport >> [ core overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC