Auto-generated, do not edit.
| Modifier and Type | Field and Description |
|---|---|
| private final Stack | attStack
stack of |
| private AttributesImpl | currentAtts
current attributes set. |
| private NGCCEventReceiver | currentHandler
The current NGCCHandler. |
| pack-priv static final String | IMPOSSIBLE
Impossible token. |
| private int | |
| private Locator | |
| private final ArrayList | namespaces
in-scope namespace mapping. |
| private boolean | |
| private int | nsEffectivePtr
Index on the namespaces array, which points to the top of the effective bindings. |
| private final Stack | nsEffectiveStack
Stack to preserve old nsEffectivePtr values. |
| private ContentHandler | redirect
When redirecting a sub-tree, this value will be non-null. |
| private int | redirectionDepth
Counts the depth of the elements when we are re-directing a sub-tree to another ContentHandler. |
| private StringBuffer | text
accumulated text. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | characters(char[] ch, int start, int length)
Implements org. Receive notification of character data. |
| public void | |
| public void | endDocument()
Implements org. Receive notification of the end of a document. |
| public void | endElement(String uri, String localname, String qname)
Implements org. Receive notification of the end of an element. |
| public void | endPrefixMapping(String prefix)
Implements org. End the scope of a prefix-URI mapping. |
| public int | |
| public Attributes | |
| public Locator | |
| public void | ignorableWhitespace(char[] ch, int start, int length)
Implements org. Receive notification of ignorable whitespace in element content. |
| public void | onEnterElementConsumed(String uri, String localName, String qname, Attributes atts)
Called by the generated handler code when an enter element event is consumed. |
| public void | |
| private void | |
| public void | processingInstruction(String target, String data)
Implements org. Receive notification of a processing instruction. |
| public void | |
| private void | processPendingText(boolean
True if the buffered character can be ignorabale. False if
it needs to be consumed. ignorable)Processes buffered text. |
| public void | redirectSubtree(ContentHandler child, String uri, String local, String qname)
This method can be called only from the enterElement handler. |
| public int | replace(NGCCEventReceiver o, NGCCEventReceiver n)
Implements com. Replaces an old handler with a new handler, and returns ID of the EventReceiver thread. |
| public void | |
| public String | |
| public void | sendEnterAttribute(int threadId, String uri, String local, String qname)
Implements com.
|
| public void | sendEnterElement(int threadId, String uri, String local, String qname, Attributes atts)
Implements com. Sends an enter element event to the specified EventReceiver thread. |
| public void | sendLeaveAttribute(int threadId, String uri, String local, String qname)
Implements com.
|
| public void | sendLeaveElement(int threadId, String uri, String local, String qname)
Implements com.
|
| public void | sendText(int threadId, String value)
Implements com.
|
| public void | setDocumentLocator(Locator _loc)
Implements org. Receive an object for locating the origin of SAX document events. |
| public void | setRootHandler(NGCCHandler rootHandler)
Sets the root handler, which will be used to parse the root element. |
| public void | skippedEntity(String name)
Implements org. Receive notification of a skipped entity. |
| public void | startDocument()
Implements org. Receive notification of the beginning of a document. |
| public void | startElement(String uri, String localname, String qname, Attributes atts)
Implements org. Receive notification of the beginning of an element. |
| public void | startPrefixMapping(String prefix, String uri)
Implements org. Begin the scope of a prefix-URI Namespace mapping. |
| public void | |
| public void | |
| protected void |
| attStack | back to summary |
|---|---|
| private final Stack<E> attStack stack of | |
| currentAtts | back to summary |
|---|---|
| private AttributesImpl currentAtts current attributes set. always equal to attStack.peek() | |
| currentHandler | back to summary |
|---|---|
| private NGCCEventReceiver currentHandler The current NGCCHandler. Always equals to handlerStack.peek() | |
| IMPOSSIBLE | back to summary |
|---|---|
| pack-priv static final String IMPOSSIBLE Impossible token. This value can never be a valid XML name. | |
| indent | back to summary |
|---|---|
| private int indent | |
| locator | back to summary |
|---|---|
| private Locator locator | |
| namespaces | back to summary |
|---|---|
| private final ArrayList<E> namespaces in-scope namespace mapping. namespaces[2n ] := prefix namespaces[2n+1] := namespace URI | |
| needIndent | back to summary |
|---|---|
| private boolean needIndent | |
| nsEffectivePtr | back to summary |
|---|---|
| private int nsEffectivePtr Index on the namespaces array, which points to
the top of the effective bindings. Because of the
timing difference between the startPrefixMapping method
and the execution of the corresponding actions,
this value can be different from For example, consider the following schema:
Code fragment X is executed after we see a startElement event,
but at this time the namespaces variable already include new
namespace bindings declared on "bob".
| |
| nsEffectiveStack | back to summary |
|---|---|
| private final Stack<E> nsEffectiveStack Stack to preserve old nsEffectivePtr values. | |
| redirect | back to summary |
|---|---|
| private ContentHandler redirect When redirecting a sub-tree, this value will be non-null. | |
| redirectionDepth | back to summary |
|---|---|
| private int redirectionDepth Counts the depth of the elements when we are re-directing a sub-tree to another ContentHandler. | |
| text | back to summary |
|---|---|
| private StringBuffer text accumulated text. | |
| NGCCRuntime | back to summary |
|---|---|
| public NGCCRuntime() | |
| characters | back to summary |
|---|---|
| public void characters(char[] ch, int start, int length) throws SAXException Implements org. Doc from org. Receive 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. Individual characters may consist of more than one Java
Your code should not assume that algorithms using
Note that some parsers will report whitespace in element
content using the
| |
| consumeAttribute | back to summary |
|---|---|
| public void consumeAttribute(int index) throws SAXException | |
| endDocument | back to summary |
|---|---|
| public void endDocument() throws SAXException Implements org. Doc from org. Receive notification of the end of a document. This method is invoked by the parser to signal it has reached the end of the document after successfully completing the parsing process. After the event, the parser will return the control to the application.
| |
| endElement | back to summary |
|---|---|
| public void endElement(String uri, String localname, String qname) throws SAXException Implements org. Doc from org. Receive notification of the end of an element. The SAX parser will invoke this method at the end of every
element in the XML document; there will be a corresponding
For information on the names, see startElement.
| |
| endPrefixMapping | back to summary |
|---|---|
| public void endPrefixMapping(String prefix) throws SAXException Implements org. Doc from org. End the scope of a prefix-URI mapping. See
| |
| getAttributeIndex | back to summary |
|---|---|
| public int getAttributeIndex(String uri, String localname) | |
| getCurrentAttributes | back to summary |
|---|---|
| public Attributes getCurrentAttributes() Attributes that belong to the current element. It's generally not recommended for applications to use this method. RelaxNGCC internally removes processed attributes, so this doesn't correctly reflect all the attributes an element carries. | |
| getLocator | back to summary |
|---|---|
| public Locator getLocator() Gets the source location of the current event. One can call this method from RelaxNGCC handlers to access the line number information. Note that to | |
| ignorableWhitespace | back to summary |
|---|---|
| public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException Implements org. Doc from org. Receive notification of ignorable whitespace in element content. Validating Parsers must use this method to report each chunk of whitespace in element content (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.
| |
| onEnterElementConsumed | back to summary |
|---|---|
| public void onEnterElementConsumed(String uri, String localName, String qname, Attributes atts) throws SAXException Called by the generated handler code when an enter element event is consumed. Pushes a new attribute set. Note that attributes are NOT pushed at the startElement method, because the processing of the enterElement event can trigger other attribute events and etc. This method will be called from one of handlers when it truely consumes the enterElement event. | |
| onLeaveElementConsumed | back to summary |
|---|---|
| public void onLeaveElementConsumed(String uri, String localName, String qname) throws SAXException | |
| printIndent | back to summary |
|---|---|
| private void printIndent() | |
| processingInstruction | back to summary |
|---|---|
| public void processingInstruction(String target, String data) throws SAXException Implements org. Doc from org. Receive notification of a processing instruction. The Parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element. A SAX parser must never report an XML declaration (XML 1.0, section 2.8) or a text declaration (XML 1.0, section 4.3.1) using this method. Like
| |
| processList | back to summary |
|---|---|
| public void processList(String str) throws SAXException | |
| processPendingText | back to summary |
|---|---|
| private void processPendingText(boolean ignorable) throws SAXException Processes buffered text. This method will be called by the start/endElement event to process buffered text as a text event. Whitespace handling is a tricky business. Consider the following schema fragment:
Assume we hit the following instance:
Then this first space needs to be ignored (for otherwise, we will
end up treating this space as the match to <text/> and won't
be able to process <bar>.)
Now assume the following instance:
This time, we need to treat this empty string as a text, for
otherwise we won't be able to accept this instance.
This is very difficult to solve in general, but one seemingly
easy solution is to use the type of next event. If a text is
followed by a start tag, it follows from the constraint on
RELAX NG that that text must be either whitespaces or a match
to On the contrary, if a text is followed by a end tag, then it cannot be whitespace unless the content model can accept empty, in which case sending a text event will be harmlessly ignored by the NGCCHandler. Thus this method take one parameter, which controls the behavior of this method. Todo according to the constraint of RELAX NG, if characters
follow an end tag, then they must be either whitespaces or
must match to
| |
| redirectSubtree | back to summary |
|---|---|
| public void redirectSubtree(ContentHandler child, String uri, String local, String qname) throws SAXException This method can be called only from the enterElement handler. The sub-tree rooted at the new element will be redirected to the specified ContentHandler. Currently active NGCCHandler will only receive the leaveElement event of the newly started element. | |
| replace | back to summary |
|---|---|
| public int replace(NGCCEventReceiver o, NGCCEventReceiver n) Implements com. Doc from com. Replaces an old handler with a new handler, and returns ID of the EventReceiver thread. | |
| reset | back to summary |
|---|---|
| public void reset() Cleans up all the data structure so that the object can be reused later. Normally, applications do not need to call this method directly, as the runtime resets itself after the endDocument method. | |
| resolveNamespacePrefix | back to summary |
|---|---|
| public String resolveNamespacePrefix(String prefix) | |
| sendEnterAttribute | back to summary |
|---|---|
| public void sendEnterAttribute(int threadId, String uri, String local, String qname) throws SAXException Implements com. | |
| sendEnterElement | back to summary |
|---|---|
| public void sendEnterElement(int threadId, String uri, String local, String qname, Attributes atts) throws SAXException Implements com. Doc from com. Sends an enter element event to the specified EventReceiver thread. | |
| sendLeaveAttribute | back to summary |
|---|---|
| public void sendLeaveAttribute(int threadId, String uri, String local, String qname) throws SAXException Implements com. | |
| sendLeaveElement | back to summary |
|---|---|
| public void sendLeaveElement(int threadId, String uri, String local, String qname) throws SAXException Implements com. | |
| sendText | back to summary |
|---|---|
| public void sendText(int threadId, String value) throws SAXException Implements com. | |
| setDocumentLocator | back to summary |
|---|---|
| public void setDocumentLocator(Locator _loc) Implements org. Doc from org. Receive an object for locating the origin of SAX document events. SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the ContentHandler interface. The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine. Note that the locator will return correct information only
during the invocation SAX event callbacks after
| |
| setRootHandler | back to summary |
|---|---|
| public void setRootHandler(NGCCHandler rootHandler) Sets the root handler, which will be used to parse the root element. This method can be called right after the object is created or the reset method is called. You can't replace the root handler while parsing is in progress.
Usually a generated class that corresponds to the
| |
| skippedEntity | back to summary |
|---|---|
| public void skippedEntity(String name) throws SAXException Implements org. Doc from org. Receive notification of a skipped entity. This is not called for entity references within markup constructs such as element start tags or markup declarations. (The XML recommendation requires reporting skipped external entities. SAX also reports internal entity expansion/non-expansion, except within markup constructs.) The Parser will invoke this method each time the entity is
skipped. Non-validating processors may skip entities if they
have not seen the declarations (because, for example, the
entity was declared in an external DTD subset). All processors
may skip external entities, depending on the values of the
| |
| startDocument | back to summary |
|---|---|
| public void startDocument() Implements org. Doc from org. Receive notification of the beginning of a document. The SAX parser will invoke this method only once, before any
other event callbacks (except for | |
| startElement | back to summary |
|---|---|
| public void startElement(String uri, String localname, String qname, Attributes atts) throws SAXException Implements org. Doc from org. Receive notification of the beginning of an element. The Parser will invoke this method at the beginning of every
element in the XML document; there will be a corresponding
This event allows up to three name components for each element:
Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
Note that the attribute list provided will contain only
attributes with explicit values (specified or defaulted):
#IMPLIED attributes will be omitted. The attribute list
will contain attributes used for Namespace declarations
(xmlns* attributes) only if the
Like
| |
| startPrefixMapping | back to summary |
|---|---|
| public void startPrefixMapping(String prefix, String uri) throws SAXException Implements org. Doc from org. Begin the scope of a prefix-URI Namespace mapping. The information from this event is not necessary for
normal Namespace processing: the SAX XML reader will
automatically replace prefixes for element and attribute
names when the There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary. Note that start/endPrefixMapping events are not
guaranteed to be properly nested relative to each other:
all startPrefixMapping events will occur immediately before the
corresponding There should never be start/endPrefixMapping events for the "xml" prefix, since it is predeclared and immutable.
| |
| trace | back to summary |
|---|---|
| public void trace(String s) | |
| traceln | back to summary |
|---|---|
| public void traceln(String s) | |
| unexpectedX | back to summary |
|---|---|
| protected void unexpectedX(String token) throws SAXException | |