|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.xanot.XanotSAXHandler
public class XanotSAXHandler
SAX xml handler. This is the actual engine that maps xml data into the model based on rules profided by rule builder.
Field Summary | |
---|---|
(package private) org.apache.log4j.Logger |
log
|
Constructor Summary | |
---|---|
XanotSAXHandler(RuleBuilder ruleBuilder)
Creates a new XanotSAXHandler object. |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
Triggered by SAX parser when encountered character data in the xml. |
void |
endDocument()
Triggered by SAX parser when the xml document ends. |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Triggered by SAX parser when an end tag is encounter. |
void |
error(org.xml.sax.SAXParseException e)
Triggered by SAX if it encouter an error when parsing. |
void |
fatalError(org.xml.sax.SAXParseException e)
Triggered by SAX if it encouter a fatal error when parsing. |
java.util.Collection<org.xml.sax.SAXParseException> |
getErrors()
Get collection of errors, collected when the parsing is running |
java.util.Collection<org.xml.sax.SAXParseException> |
getFatals()
Get collection of fatal errors, collected when the parsing is running |
java.lang.reflect.Method |
getGetterMethod(java.lang.Class klass,
java.lang.String property)
Get a getter method from a specific property name on a class. |
java.lang.Object |
getRootObject()
Get the instance of root object. |
RuleBuilder |
getRuleBuilder()
Get the rule builder that providing rules. |
java.lang.reflect.Method |
getSetterMethod(java.lang.Class klass,
java.lang.String property)
Get a setter method from a specific property name on a class. |
java.util.Collection<org.xml.sax.SAXParseException> |
getWarnings()
Get collection of warnings, collected when the parsing is running. |
boolean |
isStopOnError()
|
boolean |
isStopOnFatal()
|
boolean |
isStopOnWarning()
Check wether parsing should halt on any warning. |
void |
setErrors(java.util.Collection<org.xml.sax.SAXParseException> errors)
Set collection of errors. |
void |
setFatals(java.util.Collection<org.xml.sax.SAXParseException> fatals)
Set collection of fatal errors. |
void |
setRuleBuilder(RuleBuilder ruleBuilder)
Set the rule builder that providing rules. |
void |
setStopOnError(boolean stopOnError)
|
void |
setStopOnFatal(boolean stopOnFatal)
|
void |
setStopOnWarning(boolean stopOnWarning)
Set to stp |
void |
setWarnings(java.util.Collection<org.xml.sax.SAXParseException> warnings)
Set collection of warnings. |
void |
startDocument()
Triggered by SAX parser when it start parsing. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
Triggered by SAX parser when it encounter the starting of xml element. |
void |
warning(org.xml.sax.SAXParseException e)
Triggered by SAX parser when it encounters an Error |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
org.apache.log4j.Logger log
Constructor Detail |
---|
public XanotSAXHandler(RuleBuilder ruleBuilder)
ruleBuilder
- Rule builder that provides maping rule.Method Detail |
---|
public java.lang.Object getRootObject()
public RuleBuilder getRuleBuilder()
public void setRuleBuilder(RuleBuilder ruleBuilder)
ruleBuilder
- The ruleBuilder to set.public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ch
- Character datastart
- Start offset in the arraylength
- Length of data starting from the offset.
org.xml.sax.SAXException
- Thrown if anything goes wrong on the parsing.public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
- Thrown if anything goes wrong on the parsing.public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
uri
- URI elementlocalName
- Local nameqName
- Tag name
org.xml.sax.SAXException
- Thrown if anything goes wrong on the parsing.public java.lang.reflect.Method getSetterMethod(java.lang.Class klass, java.lang.String property)
klass
- Class to inspectproperty
- Property name
public java.lang.reflect.Method getGetterMethod(java.lang.Class klass, java.lang.String property)
klass
- Class to inspectproperty
- Property name
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
e
- The cause
org.xml.sax.SAXException
- Thrown if anything goes wrong on the parsing.public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
e
- The cause
org.xml.sax.SAXException
- Thrown if anything goes wrong on the parsing.public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
- Thrown if anything goes wrong on the parsing.public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- The URIlocalName
- Local NameqName
- Tag nameattributes
- Collection of attributes.
org.xml.sax.SAXException
- Thrown if anything goes wrong on the parsing.public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
e
- The cause
org.xml.sax.SAXException
- Thrown if anything goes wrong on the parsing.public java.util.Collection<org.xml.sax.SAXParseException> getWarnings()
public void setWarnings(java.util.Collection<org.xml.sax.SAXParseException> warnings)
warnings
- Collection warning.public java.util.Collection<org.xml.sax.SAXParseException> getErrors()
public void setErrors(java.util.Collection<org.xml.sax.SAXParseException> errors)
errors
- Collection of errorspublic java.util.Collection<org.xml.sax.SAXParseException> getFatals()
public void setFatals(java.util.Collection<org.xml.sax.SAXParseException> fatals)
fatals
- Collection of fatal errors.public boolean isStopOnWarning()
public void setStopOnWarning(boolean stopOnWarning)
stopOnWarning
- public boolean isStopOnError()
public void setStopOnError(boolean stopOnError)
public boolean isStopOnFatal()
public void setStopOnFatal(boolean stopOnFatal)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |