org.jfree.report.modules.parser.base
Class IncludeParser

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.jfree.xml.Parser
          extended byorg.jfree.report.modules.parser.base.IncludeParser
All Implemented Interfaces:
org.jfree.util.Configuration, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, java.io.Serializable

public class IncludeParser
extends org.jfree.xml.Parser

The include parser is used to support include statements in the report definition. It contains a special mark to indicate that this is a included report definition and uses the configuration settings of an parent parser.

Author:
Thomas Morgner
See Also:
Serialized Form

Field Summary
static java.lang.String INCLUDE_PARSING_KEY
          The key that indicates that this is a included parser.
 
Fields inherited from class org.jfree.xml.Parser
CONTENTBASE_KEY
 
Constructor Summary
IncludeParser(org.jfree.xml.Parser backend)
          Creates a new include parser with the given parser as backend.
 
Method Summary
 java.lang.String getConfigProperty(java.lang.String key)
          Returns the configuration property stored with the given key.
 java.lang.String getConfigProperty(java.lang.String key, java.lang.String defaultValue)
          Returns the configuration property stored with the given key using the given default values as final fallback.
 java.lang.Object getHelperObject(java.lang.String key)
          Returns a helper object which is stored on the parser.
 org.jfree.xml.Parser getInstance()
          Returns a new parser instance.
 java.lang.Object getResult()
          Returns the parser result.
 
Methods inherited from class org.jfree.xml.Parser
characters, endDocument, endElement, getCommentHandler, getComments, getInitialFactory, getLocator, peekFactory, popFactory, pushFactory, setConfigProperty, setDocumentLocator, setHelperObject, setInitialFactory, startDocument, startElement
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INCLUDE_PARSING_KEY

public static final java.lang.String INCLUDE_PARSING_KEY
The key that indicates that this is a included parser.

See Also:
Constant Field Values
Constructor Detail

IncludeParser

public IncludeParser(org.jfree.xml.Parser backend)
Creates a new include parser with the given parser as backend.

Parameters:
backend - the backend parser that provides the configuration.
Method Detail

getInstance

public org.jfree.xml.Parser getInstance()
Returns a new parser instance.

Returns:
the new include parser instance using the same backend as this instance.
See Also:
Parser.getInstance()

getResult

public java.lang.Object getResult()
Returns the parser result. Returns the backends result.

Returns:
the backends result.
See Also:
Parser.getResult()

getConfigProperty

public java.lang.String getConfigProperty(java.lang.String key)
Returns the configuration property stored with the given key. Uses the backend as provider for the default value.

Parameters:
key - the property name.
Returns:
the stored value
See Also:
Configuration.getConfigProperty(java.lang.String)

getConfigProperty

public java.lang.String getConfigProperty(java.lang.String key,
                                          java.lang.String defaultValue)
Returns the configuration property stored with the given key using the given default values as final fallback. Uses the backend as provider for the default value. The backends value will be used before the default value is returned.

Parameters:
key - the property name.
defaultValue - the default value that should be returned in case that neither this parser or the backend contains a value for that key.
Returns:
the stored value
See Also:
Configuration.getConfigProperty(java.lang.String)

getHelperObject

public java.lang.Object getHelperObject(java.lang.String key)
Returns a helper object which is stored on the parser. If the helper object is not defined in this object, this method will look for it in the backend.

Parameters:
key - the helper object key
Returns:
the helper object or null if there is no such object stored.
See Also:
Parser.getHelperObject(java.lang.String)