Class DTDHandlerBase
- All Implemented Interfaces:
DTDEventListener,EventListener
-
Field Summary
Fields inherited from interface com.sun.msv.scanner.dtd.DTDEventListener
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattributeDecl(String elementName, String attributeName, String attributeType, String[] enumeration, short attributeUse, String defaultValue) For each entry in an ATTLIST declaration, this event will be fired.voidcharacters(char[] ch, int start, int length) Receive notification of character data.voidchildElement(String elementName, short occurence) voidReceive notification that a comment has been read.voidconnector(short connectorType) Connectors in one model group is guaranteed to be the same.voidendCDATA()Receive notification that the CDATA section finished.voidendContentModel(String elementName, short contentModelType) receives notification that parsing of content model is finished.voidendDTD()Receive notification of the end of a DTD.voidendModelGroup(short occurence) voidvoidexternalGeneralEntityDecl(String n, String p, String s) Receive notification of an external parsed general entity declaration event.voidexternalParameterEntityDecl(String n, String p, String s) Receive notification of an external parameter entity declaration event.voidvoidignorableWhitespace(char[] ch, int start, int length) Receive notification of ignorable whitespace in element content.voidReceive notification of a internal general entity declaration event.voidReceive notification of a internal parameter entity declaration event.voidmixedElement(String elementName) receives notification of child element of mixed content model.voidnotationDecl(String name, String publicId, String systemId) Receive notification of a Notation Declaration.voidprocessingInstruction(String target, String data) Receive notification of a Processing Instruction.voidvoidReceive notification that a CDATA section is beginning.voidstartContentModel(String elementName, short contentModelType) receives notification that parsing of content model is beginning.voidstartDTD(InputEntity in) Receive notification of the beginning of the DTD.voidvoidunparsedEntityDecl(String name, String publicId, String systemId, String notationName) Receive notification of an unparsed entity declaration.voidwarning(SAXParseException err)
-
Constructor Details
-
DTDHandlerBase
public DTDHandlerBase()
-
-
Method Details
-
processingInstruction
Description copied from interface:DTDEventListenerReceive notification of a Processing Instruction. Processing instructions contain information meaningful to the application.- Specified by:
processingInstructionin interfaceDTDEventListener- Parameters:
target- The target of the proceessing instruction which should have meaning to the application.data- The instruction itself which should contain valid XML characters.- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceDTDEventListener
-
fatalError
- Specified by:
fatalErrorin interfaceDTDEventListener- Throws:
SAXException
-
error
- Specified by:
errorin interfaceDTDEventListener- Throws:
SAXException
-
warning
- Specified by:
warningin interfaceDTDEventListener- Throws:
SAXException
-
notationDecl
Description copied from interface:DTDEventListenerReceive notification of a Notation Declaration. Notation declarations are used by elements and entities for identifying embedded non-XML data.- Specified by:
notationDeclin interfaceDTDEventListener- Parameters:
name- The notation name, referred to by entities and elements.publicId- The public identifiersystemId- The system identifier- Throws:
SAXException
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException Description copied from interface:DTDEventListenerReceive notification of an unparsed entity declaration. Unparsed entities are non-XML data.- Specified by:
unparsedEntityDeclin interfaceDTDEventListener- Parameters:
name- The name of the unparsed entity.publicId- The public identifiersystemId- The system identifiernotationName- The associated notation- Throws:
SAXException
-
endDTD
Description copied from interface:DTDEventListenerReceive notification of the end of a DTD. The parser will invoke this method only once.- Specified by:
endDTDin interfaceDTDEventListener- Throws:
SAXException- See Also:
-
externalGeneralEntityDecl
Description copied from interface:DTDEventListenerReceive notification of an external parsed general entity declaration event.If a system identifier is present, and it is a relative URL, the parser will have resolved it fully before passing it through this method to a listener.
- Specified by:
externalGeneralEntityDeclin interfaceDTDEventListener- Parameters:
n- The entity name.p- The entity's public identifier, or null if none was given.s- The entity's system identifier.- Throws:
SAXException- See Also:
-
internalGeneralEntityDecl
Description copied from interface:DTDEventListenerReceive notification of a internal general entity declaration event.- Specified by:
internalGeneralEntityDeclin interfaceDTDEventListener- Parameters:
n- The internal general entity name.v- The value of the entity, which may include unexpanded entity references. Character references will have been expanded.- Throws:
SAXException- See Also:
-
externalParameterEntityDecl
Description copied from interface:DTDEventListenerReceive notification of an external parameter entity declaration event.If a system identifier is present, and it is a relative URL, the parser will have resolved it fully before passing it through this method to a listener.
- Specified by:
externalParameterEntityDeclin interfaceDTDEventListener- Parameters:
n- The parameter entity name.p- The entity's public identifier, or null if none was given.s- The entity's system identifier.- Throws:
SAXException- See Also:
-
internalParameterEntityDecl
Description copied from interface:DTDEventListenerReceive notification of a internal parameter entity declaration event.- Specified by:
internalParameterEntityDeclin interfaceDTDEventListener- Parameters:
n- The internal parameter entity name.v- The value of the entity, which may include unexpanded entity references. Character references will have been expanded.- Throws:
SAXException- See Also:
-
startDTD
Description copied from interface:DTDEventListenerReceive notification of the beginning of the DTD.- Specified by:
startDTDin interfaceDTDEventListener- Parameters:
in- Current input entity.- Throws:
SAXException- See Also:
-
comment
Description copied from interface:DTDEventListenerReceive notification that a comment has been read.Note that processing instructions are the mechanism designed to hold information for consumption by applications, not comments. XML systems may rely on applications being able to access information found in processing instructions; this is not true of comments, which are typically discarded.
- Specified by:
commentin interfaceDTDEventListener- Parameters:
n- the text within the comment delimiters.- Throws:
SAXException
-
characters
Description copied from interface:DTDEventListenerReceive notification of character data.The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.
The application must not attempt to read from the array outside of the specified range.
Note that some parsers will report whitespace using the ignorableWhitespace() method rather than this one (validating parsers must do so).
- Specified by:
charactersin interfaceDTDEventListener- Parameters:
ch- The characters from the DTD.start- The start position in the array.length- The number of characters to read from the array.- Throws:
SAXException- See Also:
-
ignorableWhitespace
Description copied from interface:DTDEventListenerReceive notification of ignorable whitespace in element content.Validating Parsers must use this method to report each chunk of ignorable whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models.
SAX parsers may return all contiguous whitespace in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.
The application must not attempt to read from the array outside of the specified range.
- Specified by:
ignorableWhitespacein interfaceDTDEventListener- Parameters:
ch- The characters from the DTD.start- The start position in the array.length- The number of characters to read from the array.- Throws:
SAXException- See Also:
-
startCDATA
Description copied from interface:DTDEventListenerReceive notification that a CDATA section is beginning. Data in a CDATA section is is reported through the appropriate event, either characters() or ignorableWhitespace.- Specified by:
startCDATAin interfaceDTDEventListener- Throws:
SAXException- See Also:
-
endCDATA
Description copied from interface:DTDEventListenerReceive notification that the CDATA section finished.- Specified by:
endCDATAin interfaceDTDEventListener- Throws:
SAXException- See Also:
-
startContentModel
Description copied from interface:DTDEventListenerreceives notification that parsing of content model is beginning.- Specified by:
startContentModelin interfaceDTDEventListener- Parameters:
elementName- name of the element whose content model is going to be defined.contentModelType-DTDEventListener.CONTENT_MODEL_EMPTYthis element has EMPTY content model. This notification will be immediately followed by the corresponding endContentModel.DTDEventListener.CONTENT_MODEL_ANYthis element has ANY content model. This notification will be immediately followed by the corresponding endContentModel.DTDEventListener.CONTENT_MODEL_MIXEDthis element has mixed content model. #PCDATA will not be reported. each child element will be reported by mixedElement method.DTDEventListener.CONTENT_MODEL_CHILDRENthis 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- Throws:
SAXException
-
endContentModel
Description copied from interface:DTDEventListenerreceives notification that parsing of content model is finished.- Specified by:
endContentModelin interfaceDTDEventListener- Throws:
SAXException
-
attributeDecl
public void attributeDecl(String elementName, String attributeName, String attributeType, String[] enumeration, short attributeUse, String defaultValue) throws SAXException Description copied from interface:DTDEventListenerFor each entry in an ATTLIST declaration, this event will be fired.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.
- Specified by:
attributeDeclin interfaceDTDEventListener- Throws:
SAXException
-
childElement
- Specified by:
childElementin interfaceDTDEventListener- Throws:
SAXException
-
mixedElement
Description copied from interface:DTDEventListenerreceives notification of child element of mixed content model. this method is called for each child element.- Specified by:
mixedElementin interfaceDTDEventListener- Throws:
SAXException- See Also:
-
startModelGroup
- Specified by:
startModelGroupin interfaceDTDEventListener- Throws:
SAXException
-
endModelGroup
- Specified by:
endModelGroupin interfaceDTDEventListener- Throws:
SAXException
-
connector
Description copied from interface:DTDEventListenerConnectors in one model group is guaranteed to be the same.IOW, you'll never see an event sequence like (a|b,c)
- Specified by:
connectorin interfaceDTDEventListener- Throws:
SAXException
-