Class AbstractXMLHandler
java.lang.Object
de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
de.uni_trier.wi2.procake.data.io.IOImpl
de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.AbstractXMLHandler
- All Implemented Interfaces:
IO
,ContentHandler
- Direct Known Subclasses:
AdaptationConfigHandler
,DependencyHandler
,ModelHandler
,NESTGraphHandler
,ObjectHandler
,ObjectPoolHandler
,SimilarityModelHandler
,TrainingObjectPoolHandler
,TransformationConfigHandler
,WorkflowHandler
Base-class for all XML-handler-implementations.
- Author:
- Alexander Stromer
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.IO
DEFAULT_ENCODING, LOG_FILE_NOT_FOUND, LOG_IO_EXCEPTION, LOG_READER_NOT_FOUND, LOG_SAX_EXCEPTION, LOG_UNKNOWN_PARAMETER, LOG_WRONG_PARAMATER_TYPE, RESOURCE_XML
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
callSubHandlerEnd
(String uri, String localName, String qName) Tries to call a subHandler with the given (SAX-)parameters.protected boolean
callSubHandlerStart
(String uri, String localName, String qName, Attributes attributes) Tries to call a subHandler with the given (SAX-)parameters.void
characters
(char[] ch, int start, int length) void
void
endPrefixMapping
(String prefix) protected String
Gets the characterstream between the last open-tag and the last-closing tag.abstract Object
After parsing the document, this method must be called to get the Object.void
ignorableWhitespace
(char[] ch, int start, int length) protected void
initiateSubHandler
(String uri, String localName, String qName, Attributes attributes) Calls the appropriate handler for the given (SAX-)parametersabstract boolean
isHandlerFor
(String uri, String localName, String qName, Attributes attributes) Queries the handler for possible handling of the given (SAX-)parametersprotected void
notifyParentHandler
(Object subHandlerObject) Notifies the parentHandler about the fact, that the object finished importing, which the subHandler had to managevoid
processingInstruction
(String target, String data) void
setDocumentLocator
(Locator documentLocator) void
setParentHandler
(AbstractXMLHandler parentHandler) void
skippedEntity
(String name) void
void
startPrefixMapping
(String prefix, String uri) abstract void
subHandlerFinishedWithObject
(Object subHandlerObject) Methods inherited from class de.uni_trier.wi2.procake.data.io.IOImpl
getFamily, getParameters, postInit, preInit, setFamily
Methods inherited from class de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
getParameter, initParametersBasedOn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration, endElement, startElement
-
Constructor Details
-
AbstractXMLHandler
public AbstractXMLHandler()
-
-
Method Details
-
getDocumentLocator
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
endDocument
public void endDocument()- Specified by:
endDocument
in interfaceContentHandler
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) - Specified by:
ignorableWhitespace
in interfaceContentHandler
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
-
startDocument
public void startDocument()- Specified by:
startDocument
in interfaceContentHandler
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
-
initiateSubHandler
protected void initiateSubHandler(String uri, String localName, String qName, Attributes attributes) throws SAXException Calls the appropriate handler for the given (SAX-)parameters- Parameters:
uri
- aString
objectlocalName
- aString
objectqName
- aString
objectattributes
- aAttributes
object- Throws:
SAXException
-
callSubHandlerStart
protected boolean callSubHandlerStart(String uri, String localName, String qName, Attributes attributes) throws SAXException Tries to call a subHandler with the given (SAX-)parameters. If none is available, false is returned.- Parameters:
uri
- aString
objectlocalName
- aString
objectqName
- aString
objectattributes
- aAttributes
object- Returns:
- a boolean
- Throws:
SAXException
-
callSubHandlerEnd
Tries to call a subHandler with the given (SAX-)parameters. If none is available, false is returned.- Parameters:
uri
- aString
objectlocalName
- aString
objectqName
- aString
object- Returns:
- a boolean
- Throws:
SAXException
-
subHandlerFinishedWithObject
-
notifyParentHandler
Notifies the parentHandler about the fact, that the object finished importing, which the subHandler had to manage- Parameters:
subHandlerObject
- the object, which was finished importing
-
setParentHandler
-
characters
public void characters(char[] ch, int start, int length) Appends the given characters, at the given position, to the internal StringBuffer
- Specified by:
characters
in interfaceContentHandler
-
getCharacterString
Gets the characterstream between the last open-tag and the last-closing tag. It does only make sense reading this variable at a closing-tag.- Returns:
- a
String
object
-
getObject
After parsing the document, this method must be called to get the Object. This method can only be called once, because after calling the internal variables are resetted to reuse the object. -
isHandlerFor
public abstract boolean isHandlerFor(String uri, String localName, String qName, Attributes attributes) Queries the handler for possible handling of the given (SAX-)parameters- Parameters:
uri
-localName
-qName
-attributes
-- Returns:
-