|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.msv.reader.dtd.DTDReader
constructs RELAXModule
object that exactly matches to
the parsed DTD.
Note that this class does NOT extend GrammarReader, because DTD
is not written in XML format.
Field Summary | |
static String |
ERR_UNDECLARED_PREFIX
|
static String |
ERR_UNDEFINED_ELEMENT
|
static String |
WRN_ATTEMPT_TO_USE_NAMESPACE
|
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 | |
DTDReader(GrammarReaderController controller,
String targetNamespace,
ExpressionPool pool)
|
Method Summary | |
void |
attributeDecl(String elementName,
String attributeName,
String attributeType,
String[] enums,
short attributeUse,
String defaultValue)
|
void |
characters(char[] ch,
int start,
int length)
Receive notification of character data. |
void |
childElement(String elementName,
short occurence)
|
void |
comment(String n)
Receive notification that a comment has been read. |
void |
connector(short type)
|
void |
endCDATA()
Receive notification that the CDATA section finished. |
void |
endContentModel(String elementName,
short type)
receives notification that parsing of content model is finished. |
void |
endDTD()
Receive notification of the end of a DTD. |
void |
endModelGroup(short occurence)
|
void |
error(SAXParseException e)
|
void |
externalGeneralEntityDecl(String n,
String p,
String s)
Receive notification of an external parsed general entity declaration event. |
void |
externalParameterEntityDecl(String n,
String p,
String s)
Receive notification of an external parameter entity declaration event. |
void |
fatalError(SAXParseException e)
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Receive notification of ignorable whitespace in element content. |
void |
internalGeneralEntityDecl(String n,
String v)
Receive notification of a internal general entity declaration event. |
void |
internalParameterEntityDecl(String n,
String v)
Receive notification of a internal parameter entity declaration event. |
boolean |
isUnparsedEntity(String entityName)
|
void |
mixedElement(String elementName)
receives notification of child element of mixed content model. |
void |
notationDecl(String name,
String publicId,
String systemId)
Receive notification of a Notation Declaration. |
static TREXGrammar |
parse(InputSource source,
GrammarReaderController controller)
|
static TREXGrammar |
parse(InputSource source,
GrammarReaderController controller,
String targetNamespace,
ExpressionPool pool)
|
void |
processingInstruction(String target,
String data)
Receive notification of a Processing Instruction. |
String |
resolveNamespacePrefix(String prefix)
|
void |
setDocumentLocator(Locator loc)
|
void |
startCDATA()
Receive notification that a CDATA section is beginning. |
void |
startContentModel(String elementName,
short type)
receives notification that parsing of content model is beginning. |
void |
startDTD(InputEntity in)
Receive notification of the beginning of the DTD. |
void |
startModelGroup()
|
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
Receive notification of an unparsed entity declaration. |
void |
warning(SAXParseException e)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String ERR_UNDEFINED_ELEMENT
public static final String WRN_ATTEMPT_TO_USE_NAMESPACE
public static final String ERR_UNDECLARED_PREFIX
Constructor Detail |
public DTDReader(GrammarReaderController controller, String targetNamespace, ExpressionPool pool)
Method Detail |
public static TREXGrammar parse(InputSource source, GrammarReaderController controller)
public static TREXGrammar parse(InputSource source, GrammarReaderController controller, String targetNamespace, ExpressionPool pool)
public void setDocumentLocator(Locator loc)
setDocumentLocator
in interface DTDEventListener
public void startContentModel(String elementName, short type)
DTDEventListener
startContentModel
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
elementName
- name of the element whose content model is going to be defined.contentModelType
- CONTENT_MODEL_EMPTY
this element has EMPTY content model. This notification
will be immediately followed by the corresponding endContentModel.
CONTENT_MODEL_ANY
this element has ANY content model. This notification
will be immediately followed by the corresponding endContentModel.
CONTENT_MODEL_MIXED
this element has mixed content model. #PCDATA will not be reported.
each child element will be reported by mixedElement method.
CONTENT_MODEL_CHILDREN
this elemen has child content model. The actual content model will
be reported by childElement, startModelGroup, endModelGroup, and
connector methods.public void endContentModel(String elementName, short type)
DTDEventListener
endContentModel
in interface DTDEventListener
public void childElement(String elementName, short occurence)
childElement
in interface DTDEventListener
public void mixedElement(String elementName)
DTDEventListener
mixedElement
in interface DTDEventListener
public void startModelGroup()
startModelGroup
in interface DTDEventListener
public void endModelGroup(short occurence)
endModelGroup
in interface DTDEventListener
public void connector(short type) throws SAXException
connector
in interface DTDEventListener
public void attributeDecl(String elementName, String attributeName, String attributeType, String[] enums, short attributeUse, String defaultValue) throws SAXException
attributeDecl
in interface DTDEventListener
public void endDTD() throws SAXException
DTDEventListener
endDTD
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
SAXException.
- DTDEventListener.startDTD(com.sun.msv.scanner.dtd.InputEntity)
public void fatalError(SAXParseException e) throws SAXException
fatalError
in interface DTDEventListener
public void error(SAXParseException e) throws SAXException
error
in interface DTDEventListener
public void warning(SAXParseException e) throws SAXException
warning
in interface DTDEventListener
public boolean isUnparsedEntity(String entityName)
public String resolveNamespacePrefix(String prefix)
public void processingInstruction(String target, String data) throws SAXException
DTDEventListener
processingInstruction
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
target
- The target of the proceessing instruction
which should have meaning to the application.data
- The instruction itself which should contain
valid XML characters.SAXException
- public void notationDecl(String name, String publicId, String systemId) throws SAXException
DTDEventListener
notationDecl
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
name
- The notation name, referred to by entities and
elements.publicId
- The public identifiersystemId
- The system identifierpublic void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
DTDEventListener
unparsedEntityDecl
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
name
- The name of the unparsed entity.publicId
- The public identifiersystemId
- The system identifiernotationName
- The associated notationpublic void externalGeneralEntityDecl(String n, String p, String s) throws SAXException
DTDEventListener
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.
externalGeneralEntityDecl
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
name
- The entity name.publicId
- The entity's public identifier, or null if
none was given.systemId
- The entity's system identifier.SAXException.
- DTDEventListener.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void internalGeneralEntityDecl(String n, String v) throws SAXException
DTDEventListener
internalGeneralEntityDecl
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
name
- The internal general entity name.value
- The value of the entity, which may include unexpanded
entity references. Character references will have been
expanded.SAXException.
- DTDEventListener.externalGeneralEntityDecl(java.lang.String, java.lang.String, java.lang.String)
public void externalParameterEntityDecl(String n, String p, String s) throws SAXException
DTDEventListener
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.
externalParameterEntityDecl
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
name
- The parameter entity name.publicId
- The entity's public identifier, or null if
none was given.systemId
- The entity's system identifier.SAXException.
- DTDEventListener.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void internalParameterEntityDecl(String n, String v) throws SAXException
DTDEventListener
internalParameterEntityDecl
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
name
- The internal parameter entity name.value
- The value of the entity, which may include unexpanded
entity references. Character references will have been
expanded.SAXException.
- DTDEventListener.externalParameterEntityDecl(java.lang.String, java.lang.String, java.lang.String)
public void startDTD(InputEntity in) throws SAXException
DTDEventListener
startDTD
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
in
- Current input entity.DTDEventListener.endDTD()
public void comment(String n) throws SAXException
DTDEventListener
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.
comment
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
text
- the text within the comment delimiters.SAXException
- public void characters(char[] ch, int start, int length) throws SAXException
DTDEventListener
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).
characters
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
ch
- The characters from the DTD.start
- The start position in the array.length
- The number of characters to read from the array.SAXException
- DTDEventListener.ignorableWhitespace(char[], int, int)
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
DTDEventListener
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.
ignorableWhitespace
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
ch
- The characters from the DTD.start
- The start position in the array.length
- The number of characters to read from the array.SAXException
- DTDEventListener.characters(char[], int, int)
public void startCDATA() throws SAXException
DTDEventListener
startCDATA
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
SAXException
- DTDEventListener.endCDATA()
public void endCDATA() throws SAXException
DTDEventListener
endCDATA
in interface DTDEventListener
com.sun.msv.scanner.dtd.DTDEventListener
SAXException
- DTDEventListener.startCDATA()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |