- 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.DTDHandlerBaseParses 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
Constructors Modifier Constructor Description protectedTDTDReader(ErrorReceiver errorReceiver, Options opts, InputSource _bindInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattributeDecl(String elementName, String attributeName, String attributeType, String[] enumeration, short attributeUse, String defaultValue)voidchildElement(String elementName, short occurence)voidconnector(short connectorType)protected CPropertyInfocreateAttribute(String elementName, String attributeName, String attributeType, String[] enums, short attributeUse, String defaultValue)voidendContentModel(String elementName, short contentModelType)voidendDTD()voidendModelGroup(short occurence)protected voiderror(Locator loc, String prop, Object... args)voiderror(SAXParseException e)voidfatalError(SAXParseException e)static Modelparse(InputSource dtd, InputSource bindingInfo, ErrorReceiver errorReceiver, Options opts)Parses DTD grammar and a binding information into BGM.voidsetDocumentLocator(Locator loc)voidstartContentModel(String elementName, short contentModelType)voidstartDTD(com.sun.xml.dtdparser.InputEntity entity)voidstartModelGroup()voidwarning(SAXParseException e)-
Methods inherited from class com.sun.xml.dtdparser.DTDHandlerBase
characters, comment, endCDATA, externalGeneralEntityDecl, externalParameterEntityDecl, ignorableWhitespace, internalGeneralEntityDecl, internalParameterEntityDecl, mixedElement, notationDecl, processingInstruction, startCDATA, unparsedEntityDecl
-
-
-
-
Constructor Detail
-
TDTDReader
protected TDTDReader(ErrorReceiver errorReceiver, Options opts, InputSource _bindInfo) throws AbortException
- Throws:
AbortException
-
-
Method Detail
-
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
public void startDTD(com.sun.xml.dtdparser.InputEntity entity) throws SAXException- Specified by:
startDTDin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
startDTDin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXException- Specified by:
endDTDin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
endDTDin 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:
attributeDeclin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
attributeDeclin 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
public void startContentModel(String elementName, short contentModelType) throws SAXException
- Specified by:
startContentModelin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
startContentModelin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
endContentModel
public void endContentModel(String elementName, short contentModelType) throws SAXException
- Specified by:
endContentModelin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
endContentModelin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
startModelGroup
public void startModelGroup() throws SAXException- Specified by:
startModelGroupin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
startModelGroupin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
endModelGroup
public void endModelGroup(short occurence) throws SAXException- Specified by:
endModelGroupin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
endModelGroupin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
connector
public void connector(short connectorType) throws SAXException- Specified by:
connectorin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
connectorin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
childElement
public void childElement(String elementName, short occurence) throws SAXException
- Specified by:
childElementin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
childElementin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
setDocumentLocator
public void setDocumentLocator(Locator loc)
- Specified by:
setDocumentLocatorin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
setDocumentLocatorin classcom.sun.xml.dtdparser.DTDHandlerBase
-
error
public void error(SAXParseException e) throws SAXException
- Specified by:
errorin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
errorin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
fatalError
public void fatalError(SAXParseException e) throws SAXException
- Specified by:
fatalErrorin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
fatalErrorin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
warning
public void warning(SAXParseException e) throws SAXException
- Specified by:
warningin interfacecom.sun.xml.dtdparser.DTDEventListener- Overrides:
warningin classcom.sun.xml.dtdparser.DTDHandlerBase- Throws:
SAXException
-
-