DTDEventListener, java.util.EventListenerpublic class TDTDReader extends DTDHandlerBase
CHOICE, CONTENT_MODEL_ANY, CONTENT_MODEL_CHILDREN, CONTENT_MODEL_EMPTY, CONTENT_MODEL_MIXED, OCCURENCE_ONCE, OCCURENCE_ONE_OR_MORE, OCCURENCE_ZERO_OR_MORE, OCCURENCE_ZERO_OR_ONE, SEQUENCE, USE_FIXED, USE_IMPLIED, USE_NORMAL, USE_REQUIRED| Modifier | Constructor | Description |
|---|---|---|
protected |
TDTDReader(ErrorReceiver errorReceiver,
Options opts,
org.xml.sax.InputSource _bindInfo) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
attributeDecl(java.lang.String elementName,
java.lang.String attributeName,
java.lang.String attributeType,
java.lang.String[] enumeration,
short attributeUse,
java.lang.String defaultValue) |
For each entry in an ATTLIST declaration,
this event will be fired.
|
void |
childElement(java.lang.String elementName,
short occurence) |
|
void |
connector(short connectorType) |
Connectors in one model group is guaranteed to be the same.
|
protected CPropertyInfo |
createAttribute(java.lang.String elementName,
java.lang.String attributeName,
java.lang.String attributeType,
java.lang.String[] enums,
short attributeUse,
java.lang.String defaultValue) |
|
void |
endContentModel(java.lang.String elementName,
short contentModelType) |
receives notification that parsing of content model is finished.
|
void |
endDTD() |
Receive notification of the end of a DTD.
|
void |
endModelGroup(short occurence) |
|
protected void |
error(org.xml.sax.Locator loc,
java.lang.String prop,
java.lang.Object... args) |
|
void |
error(org.xml.sax.SAXParseException e) |
|
void |
fatalError(org.xml.sax.SAXParseException e) |
|
static Model |
parse(org.xml.sax.InputSource dtd,
org.xml.sax.InputSource bindingInfo,
ErrorReceiver errorReceiver,
Options opts) |
Parses DTD grammar and a binding information into BGM.
|
void |
setDocumentLocator(org.xml.sax.Locator loc) |
|
void |
startContentModel(java.lang.String elementName,
short contentModelType) |
receives notification that parsing of content model is beginning.
|
void |
startDTD(InputEntity entity) |
Receive notification of the beginning of the DTD.
|
void |
startModelGroup() |
|
void |
warning(org.xml.sax.SAXParseException e) |
characters, comment, endCDATA, externalGeneralEntityDecl, externalParameterEntityDecl, ignorableWhitespace, internalGeneralEntityDecl, internalParameterEntityDecl, mixedElement, notationDecl, processingInstruction, startCDATA, unparsedEntityDeclprotected TDTDReader(ErrorReceiver errorReceiver, Options opts, org.xml.sax.InputSource _bindInfo) throws AbortException
AbortExceptionpublic static Model parse(org.xml.sax.InputSource dtd, org.xml.sax.InputSource bindingInfo, ErrorReceiver errorReceiver, Options opts)
This method is just a utility method that covers 80% of the use cases.
bindingInfo - binding information file, if any. Can be null.public void startDTD(InputEntity entity) throws org.xml.sax.SAXException
DTDEventListenerstartDTD in interface DTDEventListenerstartDTD in class DTDHandlerBaseentity - Current input entity.org.xml.sax.SAXExceptionDTDEventListener.endDTD()public void endDTD()
throws org.xml.sax.SAXException
DTDEventListenerendDTD in interface DTDEventListenerendDTD in class DTDHandlerBaseorg.xml.sax.SAXExceptionDTDEventListener.startDTD(InputEntity)public void attributeDecl(java.lang.String elementName,
java.lang.String attributeName,
java.lang.String attributeType,
java.lang.String[] enumeration,
short attributeUse,
java.lang.String defaultValue)
throws org.xml.sax.SAXException
DTDEventListener
DTD allows the same attributes to be declared more than once, and in that case the first one wins. I think this method will be only fired for the first one, but I need to check.
attributeDecl in interface DTDEventListenerattributeDecl in class DTDHandlerBaseorg.xml.sax.SAXExceptionprotected CPropertyInfo createAttribute(java.lang.String elementName, java.lang.String attributeName, java.lang.String attributeType, java.lang.String[] enums, short attributeUse, java.lang.String defaultValue) throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionpublic void startContentModel(java.lang.String elementName,
short contentModelType)
throws org.xml.sax.SAXException
DTDEventListenerstartContentModel in interface DTDEventListenerstartContentModel in class DTDHandlerBaseelementName - name of the element whose content model is going to be defined.contentModelType - DTDEventListener.CONTENT_MODEL_EMPTY
this element has EMPTY content model. This notification
will be immediately followed by the corresponding endContentModel.
DTDEventListener.CONTENT_MODEL_ANY
this element has ANY content model. This notification
will be immediately followed by the corresponding endContentModel.
DTDEventListener.CONTENT_MODEL_MIXED
this element has mixed content model. #PCDATA will not be reported.
each child element will be reported by mixedElement method.
DTDEventListener.CONTENT_MODEL_CHILDREN
this elemen has child content model. The actual content model will
be reported by childElement, startModelGroup, endModelGroup, and
connector methods. Possible call sequences are:
START := MODEL_GROUP MODEL_GROUP := startModelGroup TOKEN (connector TOKEN)* endModelGroup TOKEN := childElement | MODEL_GROUP
org.xml.sax.SAXExceptionpublic void endContentModel(java.lang.String elementName,
short contentModelType)
throws org.xml.sax.SAXException
DTDEventListenerendContentModel in interface DTDEventListenerendContentModel in class DTDHandlerBaseorg.xml.sax.SAXExceptionpublic void startModelGroup()
throws org.xml.sax.SAXException
startModelGroup in interface DTDEventListenerstartModelGroup in class DTDHandlerBaseorg.xml.sax.SAXExceptionpublic void endModelGroup(short occurence)
throws org.xml.sax.SAXException
endModelGroup in interface DTDEventListenerendModelGroup in class DTDHandlerBaseorg.xml.sax.SAXExceptionpublic void connector(short connectorType)
throws org.xml.sax.SAXException
DTDEventListener
IOW, you'll never see an event sequence like (a|b,c)
connector in interface DTDEventListenerconnector in class DTDHandlerBaseorg.xml.sax.SAXExceptionpublic void childElement(java.lang.String elementName,
short occurence)
throws org.xml.sax.SAXException
childElement in interface DTDEventListenerchildElement in class DTDHandlerBaseorg.xml.sax.SAXExceptionpublic void setDocumentLocator(org.xml.sax.Locator loc)
setDocumentLocator in interface DTDEventListenersetDocumentLocator in class DTDHandlerBasepublic void error(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
error in interface DTDEventListenererror in class DTDHandlerBaseorg.xml.sax.SAXExceptionpublic void fatalError(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
fatalError in interface DTDEventListenerfatalError in class DTDHandlerBaseorg.xml.sax.SAXExceptionpublic void warning(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
warning in interface DTDEventListenerwarning in class DTDHandlerBaseorg.xml.sax.SAXExceptionprotected final void error(org.xml.sax.Locator loc,
java.lang.String prop,
java.lang.Object... args)
Copyright © 2018 Oracle Corporation. All rights reserved.