Package org.jfree.xml
Class FrontendDefaultHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.jfree.xml.FrontendDefaultHandler
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Configuration
,org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
- Direct Known Subclasses:
Parser
,RootXmlReadHandler
public abstract class FrontendDefaultHandler extends org.xml.sax.helpers.DefaultHandler implements Configuration
The frontenddefault handler connects the SAX-backend with the handler implementations. It must be the base class for all parser implementations used by the ParserFrontEnd.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONTENTBASE_KEY
A key for the content base.
-
Constructor Summary
Constructors Modifier Constructor Description protected
FrontendDefaultHandler()
Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Returns a clone of the object.java.util.Iterator
findPropertyKeys(java.lang.String prefix)
Returns all keys with the given prefix.CommentHandler
getCommentHandler()
Returns the comment handler that is used to collect comments.java.util.Enumeration
getConfigProperties()
Returns the configuration properties.java.lang.String
getConfigProperty(java.lang.String key)
Returns the configuration property with the specified key.java.lang.String
getConfigProperty(java.lang.String key, java.lang.String defaultValue)
Returns the configuration property with the specified key (or the specified default value if there is no such property).java.net.URL
getContentBase()
Gets the ContentBase used to resolve relative URLs.org.xml.sax.Locator
getLocator()
Returns the current locator.abstract java.lang.Object
getResult()
Returns the parse result.abstract FrontendDefaultHandler
newInstance()
Returns a new instance of the parser.void
setConfigProperty(java.lang.String key, java.lang.String value)
Sets a parser configuration value.void
setDocumentLocator(org.xml.sax.Locator locator)
Receive an object for locating the origin of SAX document events.-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Field Detail
-
CONTENTBASE_KEY
public static final java.lang.String CONTENTBASE_KEY
A key for the content base.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FrontendDefaultHandler
protected FrontendDefaultHandler()
Default constructor.
-
-
Method Detail
-
getCommentHandler
public CommentHandler getCommentHandler()
Returns the comment handler that is used to collect comments.- Returns:
- the comment handler.
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
Receive an object for locating the origin of SAX document events. The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.- Specified by:
setDocumentLocator
in interfaceorg.xml.sax.ContentHandler
- Overrides:
setDocumentLocator
in classorg.xml.sax.helpers.DefaultHandler
- Parameters:
locator
- the locator.
-
getLocator
public org.xml.sax.Locator getLocator()
Returns the current locator.- Returns:
- the locator.
-
getConfigProperty
public java.lang.String getConfigProperty(java.lang.String key)
Returns the configuration property with the specified key.- Specified by:
getConfigProperty
in interfaceConfiguration
- Parameters:
key
- the property key.- Returns:
- the property value.
-
getConfigProperty
public java.lang.String getConfigProperty(java.lang.String key, java.lang.String defaultValue)
Returns the configuration property with the specified key (or the specified default value if there is no such property). If the property is not defined in this configuration, the code will lookup the property in the parent configuration.- Specified by:
getConfigProperty
in interfaceConfiguration
- Parameters:
key
- the property key.defaultValue
- the default value.- Returns:
- the property value.
-
setConfigProperty
public void setConfigProperty(java.lang.String key, java.lang.String value)
Sets a parser configuration value.- Parameters:
key
- the key.value
- the value.
-
getConfigProperties
public java.util.Enumeration getConfigProperties()
Description copied from interface:Configuration
Returns the configuration properties.- Specified by:
getConfigProperties
in interfaceConfiguration
- Returns:
- The configuration properties.
-
newInstance
public abstract FrontendDefaultHandler newInstance()
Returns a new instance of the parser.- Returns:
- a new instance of the parser.
-
findPropertyKeys
public java.util.Iterator findPropertyKeys(java.lang.String prefix)
Returns all keys with the given prefix.- Specified by:
findPropertyKeys
in interfaceConfiguration
- Parameters:
prefix
- the prefix- Returns:
- the iterator containing all keys with that prefix
-
getResult
public abstract java.lang.Object getResult() throws org.xml.sax.SAXException
Returns the parse result. This method is called at the end of the parsing process and expects the generated object.- Returns:
- the object.
- Throws:
org.xml.sax.SAXException
- if something went wrong.
-
getContentBase
public java.net.URL getContentBase()
Gets the ContentBase used to resolve relative URLs.- Returns:
- the current contentbase, or null if no contentBase is set.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Description copied from interface:Configuration
Returns a clone of the object.- Specified by:
clone
in interfaceConfiguration
- Overrides:
clone
in classjava.lang.Object
- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException
- if cloning is not supported for some reason.
-
-