| java.lang.Object com.sun.xml.xsom.impl.parser.state.NGCCRuntime
All known Subclasses: com.sun.xml.xsom.impl.parser.NGCCRuntimeEx,
NGCCRuntime | public class NGCCRuntime implements ContentHandler,NGCCEventSource(Code) | | Runtime Engine for RELAXNGCC execution.
This class has the following functionalities:
- Managing a stack of NGCCHandler objects and
switching between them appropriately.
- Keep track of all Attributes.
- manage mapping between namespace URIs and prefixes.
- TODO: provide support for interleaving.
version: $Id: NGCCRuntime.java,v 1.15 2002/09/29 02:55:48 okajima Exp $ author: Kohsuke Kawaguchi (kk@kohsuke.org) |
Method Summary | |
public void | characters(char[] ch, int start, int length) | public void | consumeAttribute(int index) | public void | endDocument() | public void | endElement(String uri, String localname, String qname) | public void | endPrefixMapping(String prefix) | public int | getAttributeIndex(String uri, String localname) | public Attributes | getCurrentAttributes() Attributes that belong to the current element.
It's generally not recommended for applications to use
this method. | 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. | public void | ignorableWhitespace(char[] ch, int start, int length) | 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 | onLeaveElementConsumed(String uri, String localName, String qname) | public void | processList(String str) | public void | processingInstruction(String target, String data) | public void | redirectSubtree(ContentHandler child, String uri, String local, String qname) 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.
uri,local,qnameParameters passed to the enter element event. | public int | replace(NGCCEventReceiver o, NGCCEventReceiver n) | public void | reset() Cleans up all the data structure so that the object can be reused later. | public String | resolveNamespacePrefix(String prefix) | public void | sendEnterAttribute(int threadId, String uri, String local, String qname) | public void | sendEnterElement(int threadId, String uri, String local, String qname, Attributes atts) | public void | sendLeaveAttribute(int threadId, String uri, String local, String qname) | public void | sendLeaveElement(int threadId, String uri, String local, String qname) | public void | sendText(int threadId, String value) | public void | setDocumentLocator(Locator _loc) | 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. | public void | skippedEntity(String name) | public void | startDocument() | public void | startElement(String uri, String localname, String qname, Attributes atts) | public void | startPrefixMapping(String prefix, String uri) | public void | trace(String s) | public void | traceln(String s) | protected void | unexpectedX(String token) |
IMPOSSIBLE | final static String IMPOSSIBLE(Code) | | Impossible token. This value can never be a valid XML name.
|
NGCCRuntime | public NGCCRuntime()(Code) | | |
characters | public void characters(char[] ch, int start, int length) throws SAXException(Code) | | |
getCurrentAttributes | public Attributes getCurrentAttributes()(Code) | | 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 | public Locator getLocator()(Code) | | 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 | public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException(Code) | | |
onEnterElementConsumed | public void onEnterElementConsumed(String uri, String localName, String qname, Attributes atts) throws SAXException(Code) | | 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.
|
redirectSubtree | public void redirectSubtree(ContentHandler child, String uri, String local, String qname) throws SAXException(Code) | | 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.
uri,local,qnameParameters passed to the enter element event. Used tosimulate the startElement event for the new ContentHandler. |
reset | public void reset()(Code) | | 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.
|
setDocumentLocator | public void setDocumentLocator(Locator _loc)(Code) | | |
setRootHandler | public void setRootHandler(NGCCHandler rootHandler)(Code) | | 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 <start>
pattern will be used as the root handler, but any NGCCHandler
can be a root handler.
exception: IllegalStateException - If this method is called but it doesn't satisfy thepre-condition stated above. |
startDocument | public void startDocument()(Code) | | |
|
|