Package org.jfree.xml
Class FrontendDefaultHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.jfree.xml.FrontendDefaultHandler
- All Implemented Interfaces:
Serializable
,Cloneable
,Configuration
,ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Direct Known Subclasses:
Parser
,RootXmlReadHandler
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CommentHandler
The current comment handler used to receive xml comments.static final String
A key for the content base.private Locator
The DocumentLocator can be used to resolve the current parse position.private DefaultConfiguration
Storage for the parser configuration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of this instance.findPropertyKeys
(String prefix) Returns all keys with the given prefix.Returns the comment handler that is used to collect comments.Returns the configuration properties.getConfigProperty
(String key) Returns the configuration property with the specified key.getConfigProperty
(String key, String defaultValue) Returns the configuration property with the specified key (or the specified default value if there is no such property).Gets the ContentBase used to resolve relative URLs.Returns the current locator.abstract Object
Returns the parse result.abstract FrontendDefaultHandler
Returns a new instance of the parser.void
setConfigProperty
(String key, String value) Sets a parser configuration value.void
setDocumentLocator
(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 Details
-
CONTENTBASE_KEY
A key for the content base.- See Also:
-
parserConfiguration
Storage for the parser configuration. -
locator
The DocumentLocator can be used to resolve the current parse position. -
commentHandler
The current comment handler used to receive xml comments.
-
-
Constructor Details
-
FrontendDefaultHandler
protected FrontendDefaultHandler()Default constructor.
-
-
Method Details
-
getCommentHandler
Returns the comment handler that is used to collect comments.- Returns:
- the comment handler.
-
setDocumentLocator
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 interfaceContentHandler
- Overrides:
setDocumentLocator
in classDefaultHandler
- Parameters:
locator
- the locator.
-
getLocator
Returns the current locator.- Returns:
- the locator.
-
getConfigProperty
Returns the configuration property with the specified key.- Specified by:
getConfigProperty
in interfaceConfiguration
- Parameters:
key
- the property key.- Returns:
- the property value.
-
getConfigProperty
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
Sets a parser configuration value.- Parameters:
key
- the key.value
- the value.
-
getConfigProperties
Returns the configuration properties.- Specified by:
getConfigProperties
in interfaceConfiguration
- Returns:
- An enumeration of the configuration properties.
-
newInstance
Returns a new instance of the parser.- Returns:
- a new instance of the parser.
-
findPropertyKeys
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
Returns the parse result. This method is called at the end of the parsing process and expects the generated object.- Returns:
- the object.
- Throws:
SAXException
- if something went wrong.
-
getContentBase
Gets the ContentBase used to resolve relative URLs.- Returns:
- the current contentbase, or null if no contentBase is set.
-
clone
Returns a clone of this instance.- Specified by:
clone
in interfaceConfiguration
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if there is a problem cloning.
-