GrammarReader reader = new RELAXGrammarReader(...); XMLReader parser = .... // create a new XMLReader here parser.setContentHandler(reader); parser.parse(whateverYouLike); return reader.grammar; // obtain parsed grammar.Or you may want to use several pre-defined static "parse" methods for ease of use.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| public class | GrammarReader.BackwardReferenceMap
memorizes what declarations are referenced from where. |
| public class | |
| private class | GrammarReader.InclusionContext
information that must be sheltered before switching InputSource (typically by inclusion). |
| public static interface | GrammarReader.PrefixResolver
namespace prefix to URI conversion map. |
| Modifier and Type | Field and Description |
|---|---|
| private final Vector | |
| public final GrammarReader. | backwardReference
keeps track of all backward references to every ReferenceExp. |
| public static final GrammarReader. | basePrefixResolver
The namespace prefix resolver that only resolves "xml" prefix. |
| public final Controller | controller
this object receives errors and warnings |
| private final Map | declaredLocations
this map remembers where ReferenceExps are defined, and where user defined types are defined. |
| private final Vector | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| private Locator | locator
document Locator that is given by XML reader
|
| public final SAXParserFactory | parserFactory
Reader may create another SAXParser from this factory |
| private GrammarReader. | pendingIncludes
current inclusion context |
| public final ExpressionPool | pool
this object must be used to create a new expression |
| public GrammarReader. | |
| public static final String | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| protected | GrammarReader(GrammarReaderController _controller, SAXParserFactory parserFactory, ExpressionPool pool, State initialState)
constructor that should be called from parse method. |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final void | |
| public final void | |
| public final String | combineURI(String baseURI, String relativeURI)
converts the relative URL to the absolute one by using the specified base URL. |
| public final String | |
| public abstract State | Returns: null if the start tag is an error.this method must be implemented by the derived class to create language-default expresion state. |
| protected static SAXParserFactory | |
| public void | detectUndefinedOnes(ReferenceContainer container, String errMsg)
detects undefined ReferenceExp and reports it as an error. |
| public void | endPrefixMapping(String
The Namespace prefix. prefix)Overrides org. Implements org. |
| public XSDatatype | getBackwardCompatibleType(String typeName)
tries to obtain a DataType object by resolving obsolete names. |
| public String | getBaseUri()
Implements org. |
| public final State | |
| public Locator | |
| public Locator | |
| public abstract Grammar | |
| public static Source | inputSourceFromLSInput(LSInput input)
This is a stopgap until we can wean more of this code from SAX-dependence. |
| protected Expression | interceptExpression(State state, Expression exp)
intercepts an expression made by ExpressionState before it is passed to the parent state. |
| protected abstract boolean | |
| public boolean | isNotation(String notationName)
Implements org. |
| public boolean | isUnparsedEntity(String entityName)
Implements org. |
| public Iterator | iterateInscopeNamespaces()
Iterates Map.Entry objects which has the prefix as key and the namespace URI as value. |
| protected abstract String | |
| public final void | onID(Datatype dt, StringToken token)
Implements com. |
| public final void | parse(String
The system identifier as a fully-qualified URI. source)Overrides org. Implements org. |
| public final void | parse(InputSource
The input source for the document entity. source)Overrides org. Implements org. |
| public void | |
| private void | |
| public void | |
| private Locator[] | |
| private void | |
| public void | pushState(State newState, State parentState, StartTagInfo startTag)
pushs the current state into the stack and sets new one |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | reportError(String propertyName, Object[] args, Exception nestedException, Locator[] errorLocations)
reports an error to the controller |
| public final void | |
| public final void | |
| public final void | |
| public final void | reportWarning(String propertyName, Object[] args, Locator[] locations)
reports a warning to the controller |
| public final InputSource | Returns: always return non-null valid objectThe base URI of this state is used to resolve the resource. sourceState, String uri)obtains InputSource for the specified url. |
| public String | resolveNamespacePrefix(String prefix)
Implements org. |
| public final void | |
| private final void | |
| public void | |
| public void | setDocumentLocator(Locator
The document locator. loc)Overrides org. Implements org. |
| public void | |
| public String[] | |
| public void | startPrefixMapping(String
The Namespace prefix. prefix, String The Namespace URI. uri)Overrides org. Implements org. |
| public void | switchSource(State
this state is used to resolve the URL. sourceState, String url, State this state will parse top-level of new XML source.
this state receives document element by its createChildState method. newState)Switchs InputSource to the specified URL and parses it by the specified state. |
| public void | switchSource(InputSource source, State newState)
start reading input from a source defined by a SAX InputSource. |
| public void | switchSource(Source source, State newState)
Start reading input from a source defined by a javax.xml.transform source. |