public abstract class XmlTagHandler<C extends XmlDataCollector<?>> extends org.xml.sax.helpers.DefaultHandler implements SimpleLogSupport
| Constructor and Description |
|---|
XmlTagHandler(C collector)
Constructor for the main-handler
|
XmlTagHandler(XmlTagHandler<C> parent,
java.lang.String myTag)
Constructor for secondary handlers that build on top of the main-handler
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
protected abstract XmlTagHandler<C> |
createNextHandlerFor(java.lang.String uri,
java.lang.String localName,
java.lang.String tag) |
protected void |
doOnTagDone(int lineNumber,
java.lang.String tagPath) |
protected void |
doOnTagFound(int lineNumber,
java.lang.String tagPath)
Is called when a new tag was found.
|
void |
endDocument() |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String tag) |
void |
error(org.xml.sax.SAXParseException e) |
void |
fatalError(org.xml.sax.SAXParseException e) |
protected boolean |
getAsBoolean(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected boolean |
getAsBoolean(org.xml.sax.Attributes attrs,
java.lang.String param,
boolean defaultValue) |
protected java.util.Date |
getAsDate(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected java.util.Date |
getAsDate(org.xml.sax.Attributes attrs,
java.lang.String param,
java.util.Date defaultValue) |
protected double |
getAsDouble(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected double |
getAsDouble(org.xml.sax.Attributes attrs,
java.lang.String param,
double defaultValue) |
protected float |
getAsFloat(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected float |
getAsFloat(org.xml.sax.Attributes attrs,
java.lang.String param,
float defaultValue) |
protected int |
getAsInt(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected int |
getAsInt(org.xml.sax.Attributes attrs,
java.lang.String param,
int defaultValue) |
protected long |
getAsLong(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected long |
getAsLong(org.xml.sax.Attributes attrs,
java.lang.String param,
long defaultValue) |
protected short |
getAsShort(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected short |
getAsShort(org.xml.sax.Attributes attrs,
java.lang.String param,
short defaultValue) |
protected java.lang.String |
getAsString(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected java.lang.String |
getAsString(org.xml.sax.Attributes attrs,
java.lang.String param,
java.lang.String defaultValue) |
protected java.sql.Timestamp |
getAsTimestamp(org.xml.sax.Attributes attrs,
java.lang.String param) |
protected java.sql.Timestamp |
getAsTimestamp(org.xml.sax.Attributes attrs,
java.lang.String param,
java.sql.Timestamp defaultValue) |
C |
getCollector() |
protected java.lang.String |
getFinishTag() |
FileInfo |
getInputFileInfo()
Note that only the main-handler stores the inputFile
|
LogChannel |
getLogChannel() |
XmlTagHandler<C> |
getParentHandler() |
XmlDataParser<?> |
getParser() |
java.lang.String |
getTagPath() |
boolean |
isLogDebug() |
boolean |
isLogVerbose() |
void |
logDebug(java.lang.String message) |
void |
logDump(java.lang.String message) |
void |
logError(java.lang.String message) |
void |
logError(java.lang.String message,
java.lang.Exception e) |
void |
logFatal(java.lang.String message,
java.lang.Exception e) |
void |
logInfo(java.lang.String message) |
void |
logVerbose(java.lang.String message) |
void |
logWarning(java.lang.String message) |
protected void |
processTagBody(java.lang.String bodyText) |
protected void |
processTagHead(java.lang.String tag,
org.xml.sax.Attributes attrs) |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId) |
void |
setDocumentLocator(org.xml.sax.Locator locator) |
void |
setLogChannel(LogChannel logCh) |
void |
startDocument() |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String tag,
org.xml.sax.Attributes attrs) |
java.lang.String |
toString() |
public XmlTagHandler(C collector)
public XmlTagHandler(XmlTagHandler<C> parent, java.lang.String myTag)
public java.lang.String getTagPath()
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
throws java.io.IOException,
org.xml.sax.SAXException
resolveEntity in interface org.xml.sax.EntityResolverresolveEntity in class org.xml.sax.helpers.DefaultHandlerjava.io.IOExceptionorg.xml.sax.SAXExceptionpublic void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic FileInfo getInputFileInfo()
protected java.lang.String getFinishTag()
public final void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String tag,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionprotected abstract XmlTagHandler<C> createNextHandlerFor(java.lang.String uri, java.lang.String localName, java.lang.String tag)
protected void processTagHead(java.lang.String tag,
org.xml.sax.Attributes attrs)
throws java.lang.Exception
java.lang.Exceptionpublic final void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String tag)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionprotected void processTagBody(java.lang.String bodyText)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionprotected void doOnTagFound(int lineNumber,
java.lang.String tagPath)
protected void doOnTagDone(int lineNumber,
java.lang.String tagPath)
throws java.lang.Exception
java.lang.Exceptionpublic XmlDataParser<?> getParser()
public C getCollector()
public XmlTagHandler<C> getParentHandler()
protected java.lang.String getAsString(org.xml.sax.Attributes attrs,
java.lang.String param)
protected java.lang.String getAsString(org.xml.sax.Attributes attrs,
java.lang.String param,
java.lang.String defaultValue)
protected boolean getAsBoolean(org.xml.sax.Attributes attrs,
java.lang.String param)
protected boolean getAsBoolean(org.xml.sax.Attributes attrs,
java.lang.String param,
boolean defaultValue)
protected short getAsShort(org.xml.sax.Attributes attrs,
java.lang.String param)
protected short getAsShort(org.xml.sax.Attributes attrs,
java.lang.String param,
short defaultValue)
protected int getAsInt(org.xml.sax.Attributes attrs,
java.lang.String param)
protected int getAsInt(org.xml.sax.Attributes attrs,
java.lang.String param,
int defaultValue)
protected long getAsLong(org.xml.sax.Attributes attrs,
java.lang.String param)
protected long getAsLong(org.xml.sax.Attributes attrs,
java.lang.String param,
long defaultValue)
protected float getAsFloat(org.xml.sax.Attributes attrs,
java.lang.String param)
protected float getAsFloat(org.xml.sax.Attributes attrs,
java.lang.String param,
float defaultValue)
protected double getAsDouble(org.xml.sax.Attributes attrs,
java.lang.String param)
protected double getAsDouble(org.xml.sax.Attributes attrs,
java.lang.String param,
double defaultValue)
protected java.util.Date getAsDate(org.xml.sax.Attributes attrs,
java.lang.String param)
protected java.util.Date getAsDate(org.xml.sax.Attributes attrs,
java.lang.String param,
java.util.Date defaultValue)
protected java.sql.Timestamp getAsTimestamp(org.xml.sax.Attributes attrs,
java.lang.String param)
protected java.sql.Timestamp getAsTimestamp(org.xml.sax.Attributes attrs,
java.lang.String param,
java.sql.Timestamp defaultValue)
public void error(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlererror in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void fatalError(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerfatalError in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator in interface org.xml.sax.ContentHandlersetDocumentLocator in class org.xml.sax.helpers.DefaultHandlerpublic LogChannel getLogChannel()
getLogChannel in interface SimpleLogSupportpublic void setLogChannel(LogChannel logCh)
setLogChannel in interface SimpleLogSupportpublic boolean isLogDebug()
isLogDebug in interface SimpleLogSupportpublic boolean isLogVerbose()
isLogVerbose in interface SimpleLogSupportpublic void logDebug(java.lang.String message)
logDebug in interface SimpleLogSupportpublic void logDump(java.lang.String message)
logDump in interface SimpleLogSupportpublic void logError(java.lang.String message,
java.lang.Exception e)
logError in interface SimpleLogSupportpublic void logError(java.lang.String message)
logError in interface SimpleLogSupportpublic void logFatal(java.lang.String message,
java.lang.Exception e)
logFatal in interface SimpleLogSupportpublic void logInfo(java.lang.String message)
logInfo in interface SimpleLogSupportpublic void logVerbose(java.lang.String message)
logVerbose in interface SimpleLogSupportpublic void logWarning(java.lang.String message)
logWarning in interface SimpleLogSupportpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014 EsprIT-Systems. All Rights Reserved.