Package com.sun.tools.xjc.reader.dtd
Class TDTDReader
java.lang.Object
com.sun.xml.dtdparser.DTDHandlerBase
com.sun.tools.xjc.reader.dtd.TDTDReader
- All Implemented Interfaces:
com.sun.xml.dtdparser.DTDEventListener
,EventListener
public class TDTDReader
extends com.sun.xml.dtdparser.DTDHandlerBase
Parses DTD grammar along with binding information into BGM.
- Author:
- Kohsuke KAWAGUCHI
-
Field Summary
Fields inherited from interface com.sun.xml.dtdparser.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
ConstructorsModifierConstructorDescriptionprotected
TDTDReader
(ErrorReceiver errorReceiver, Options opts, InputSource _bindInfo) -
Method Summary
Modifier and TypeMethodDescriptionvoid
attributeDecl
(String elementName, String attributeName, String attributeType, String[] enumeration, short attributeUse, String defaultValue) void
childElement
(String elementName, short occurence) void
connector
(short connectorType) protected CPropertyInfo
createAttribute
(String elementName, String attributeName, String attributeType, String[] enums, short attributeUse, String defaultValue) void
endContentModel
(String elementName, short contentModelType) void
endDTD()
void
endModelGroup
(short occurence) protected final void
void
void
static Model
parse
(InputSource dtd, InputSource bindingInfo, ErrorReceiver errorReceiver, Options opts) Parses DTD grammar and a binding information into BGM.void
void
startContentModel
(String elementName, short contentModelType) void
startDTD
(com.sun.xml.dtdparser.InputEntity entity) void
void
Methods inherited from class com.sun.xml.dtdparser.DTDHandlerBase
characters, comment, endCDATA, externalGeneralEntityDecl, externalParameterEntityDecl, ignorableWhitespace, internalGeneralEntityDecl, internalParameterEntityDecl, mixedElement, notationDecl, processingInstruction, startCDATA, unparsedEntityDecl
-
Constructor Details
-
TDTDReader
protected TDTDReader(ErrorReceiver errorReceiver, Options opts, InputSource _bindInfo) throws AbortException - Throws:
AbortException
-
-
Method Details
-
parse
public static Model parse(InputSource dtd, InputSource bindingInfo, ErrorReceiver errorReceiver, Options opts) Parses DTD grammar and a binding information into BGM.This method is just a utility method that covers 80% of the use cases.
- Parameters:
bindingInfo
- binding information file, if any. Can be null.
-
startDTD
- Specified by:
startDTD
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
startDTD
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
endDTD
- Specified by:
endDTD
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
endDTD
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
attributeDecl
public void attributeDecl(String elementName, String attributeName, String attributeType, String[] enumeration, short attributeUse, String defaultValue) throws SAXException - Specified by:
attributeDecl
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
attributeDecl
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
createAttribute
protected CPropertyInfo createAttribute(String elementName, String attributeName, String attributeType, String[] enums, short attributeUse, String defaultValue) throws SAXException - Throws:
SAXException
-
startContentModel
- Specified by:
startContentModel
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
startContentModel
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
endContentModel
- Specified by:
endContentModel
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
endContentModel
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
startModelGroup
- Specified by:
startModelGroup
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
startModelGroup
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
endModelGroup
- Specified by:
endModelGroup
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
endModelGroup
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
connector
- Specified by:
connector
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
connector
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
childElement
- Specified by:
childElement
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
childElement
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
setDocumentLocator
in classcom.sun.xml.dtdparser.DTDHandlerBase
-
error
- Specified by:
error
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
error
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
fatalError
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
warning
- Specified by:
warning
in interfacecom.sun.xml.dtdparser.DTDEventListener
- Overrides:
warning
in classcom.sun.xml.dtdparser.DTDHandlerBase
- Throws:
SAXException
-
error
-