public abstract class AbstractImportHandler extends com.escenic.common.xml.sax.AbstractContentHandler implements ImportHandler
ImportHandler
s.ImportHandlerSpi
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractImportHandler.ProviderStub
Provider stub for import handlers that are not created via SPI mechanism.
|
ImportHandler.State
Modifier and Type | Field and Description |
---|---|
protected Section |
mDefaultSection |
protected Person |
mDefaultUser |
protected XMLImportConfiguration |
mImportConfiguration |
protected org.apache.log4j.Logger |
mLogger |
protected ImportHandlerSpi |
mProvider |
protected SAXConfiguration |
mSAXConfiguration |
DEFAULT_NAMESPACE, UNKNOWN_FIELD_NAMESPACE
Constructor and Description |
---|
AbstractImportHandler(ImportHandlerSpi pProvider,
XMLImportConfiguration pImportConfiguration,
SAXConfiguration pSAXConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] pChars,
int pStart,
int pLength) |
void |
cleanup()
Clean up the handler on any error.
|
protected List<? extends ImportHandler> |
createChildHandlers() |
void |
endElement(String pNamespaceURI,
String pLocalName)
Receive notification of the end of an element.
|
void |
endElement(String pNamespaceURI,
String pLocalName,
String pQName) |
protected void |
error(String pMessage,
Exception pException) |
protected void |
fatalError(String pMessage,
Exception pException) |
protected IOAPI |
getAPI() |
protected ImportMessageHandler |
getMessageHandler() |
ImportHandler.State |
getState()
Gets the state of the handler.
|
protected String |
getSystemId() |
protected void |
handleCharacters(String pText) |
protected void |
handleEndElement(String pNamespaceURI,
String pLocalName) |
protected void |
handleStartElement(String pNamespaceURI,
String pLocalName,
Attributes pAttributes) |
protected void |
info(String pMessage,
Exception pException) |
protected boolean |
isAborted() |
protected void |
onChildHandlerCompleted(ImportHandler pActiveChildHandler,
String pNamespaceURI,
String pLocalName) |
void |
rollback()
Rollback the handler on any error.
|
protected void |
setState(ImportHandler.State pState)
Sets the state of the handler.
|
void |
startElement(String pNamespaceURI,
String pLocalName,
Attributes pAttributes)
Receive notification of the beginning of an element.
|
void |
startElement(String pNamespaceURI,
String pLocalName,
String pQName,
Attributes pAttributes) |
protected boolean |
subclassAcceptsChildElements() |
boolean |
supportsCharacters()
Checks if this handler supports characters.
|
boolean |
supportsElement(String pNamespaceURI,
String pLocalName,
Attributes pAttributes)
Checks if this handler supports an element.
|
protected Timestamp |
toTimestamp(String pTimestamp) |
protected void |
warning(String pMessage,
Exception pException) |
endDocument, endPrefixMapping, getLocator, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
protected Section mDefaultSection
protected Person mDefaultUser
protected final org.apache.log4j.Logger mLogger
protected final ImportHandlerSpi mProvider
protected final XMLImportConfiguration mImportConfiguration
protected final SAXConfiguration mSAXConfiguration
public AbstractImportHandler(ImportHandlerSpi pProvider, XMLImportConfiguration pImportConfiguration, SAXConfiguration pSAXConfiguration)
protected IOAPI getAPI()
protected final String getSystemId()
public ImportHandler.State getState()
ImportHandler
getState
in interface ImportHandler
protected void setState(ImportHandler.State pState) throws IllegalStateException
State#NOT_STARTED
=> State#INPROGRESS
State#INPROGRESS
=> State#COMPLETED
IllegalStateException
is thrown.pState
- the state.IllegalStateException
- on a not allowed transition of state.public void cleanup()
ImportHandler
cleanup
in interface ImportHandler
public void rollback()
ImportHandler
rollback
in interface ImportHandler
public final void startElement(String pNamespaceURI, String pLocalName, String pQName, Attributes pAttributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class com.escenic.common.xml.sax.AbstractContentHandler
SAXException
public void startElement(String pNamespaceURI, String pLocalName, Attributes pAttributes) throws SAXException
ImportHandler
startElement
in interface ImportHandler
pNamespaceURI
- the namespace URI.pLocalName
- the local name.pAttributes
- the attributes.SAXException
- on any error.protected boolean subclassAcceptsChildElements()
protected void handleStartElement(String pNamespaceURI, String pLocalName, Attributes pAttributes) throws SAXException
SAXException
protected List<? extends ImportHandler> createChildHandlers()
public boolean supportsCharacters()
ImportHandler
supportsCharacters
in interface ImportHandler
public void characters(char[] pChars, int pStart, int pLength) throws SAXException
characters
in interface ContentHandler
characters
in class com.escenic.common.xml.sax.AbstractContentHandler
SAXException
protected void handleCharacters(String pText) throws SAXException
SAXException
public final void endElement(String pNamespaceURI, String pLocalName, String pQName) throws SAXException
endElement
in interface ContentHandler
endElement
in class com.escenic.common.xml.sax.AbstractContentHandler
SAXException
public void endElement(String pNamespaceURI, String pLocalName) throws SAXException
ImportHandler
endElement
in interface ImportHandler
pNamespaceURI
- the namespace URI.pLocalName
- the local name.SAXException
- on any error.protected void onChildHandlerCompleted(ImportHandler pActiveChildHandler, String pNamespaceURI, String pLocalName)
protected void handleEndElement(String pNamespaceURI, String pLocalName) throws SAXException
SAXException
protected Timestamp toTimestamp(String pTimestamp) throws SAXException
SAXException
protected boolean isAborted()
protected final void fatalError(String pMessage, Exception pException) throws SAXException
SAXException
protected ImportMessageHandler getMessageHandler()
public final boolean supportsElement(String pNamespaceURI, String pLocalName, Attributes pAttributes)
ImportHandler
supportsElement
in interface ImportHandler
pNamespaceURI
- the namespace URI.pLocalName
- the local name.pAttributes
- the attributes.© 1998- 2021 Escenic AS