|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.calitha.xml.XMLGrammarPoolBuilder
public class XMLGrammarPoolBuilder
The XMLGrammarPoolBuilder represents a builder class for making XML grammar pools.
Grammar pools can be loaded with grammars (DTD's and XML Schema'a) and set in
parser configurations or
parsers.
The grammar pool pre-parses all the grammars, so that this won't have to happen again each time a parser starts validating an XML file.
| Field Summary | |
|---|---|
static String |
GRAMMAR_POOL
|
| Constructor Summary | |
|---|---|
XMLGrammarPoolBuilder()
Creates a new grammar pool builder. |
|
| Method Summary | |
|---|---|
void |
addDTDGrammar(String resourceName)
Adds a DTD grammar to the pool. |
void |
addDTDGrammar(String publicId,
String systemId,
InputStream input)
Adds a DTD grammar to the pool. |
void |
addDTDGrammar(org.apache.xerces.xni.parser.XMLInputSource source)
Adds a DTD to the grammar pool. |
void |
addSchemaGrammar(InputStream input)
Adds an XML Schema to the grammar pool. |
void |
addSchemaGrammar(String resourceName)
Adds an XML Schema to the grammar pool. |
void |
addSchemaGrammar(String publicId,
String systemId,
InputStream input)
Adds an XML Schema to the grammar pool. |
void |
addSchemaGrammar(org.apache.xerces.xni.parser.XMLInputSource source)
Adds an XML Schem to the grammar pool. |
org.apache.xerces.xni.grammars.XMLGrammarPool |
getGrammarPool()
Gets the grammar pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String GRAMMAR_POOL
| Constructor Detail |
|---|
public XMLGrammarPoolBuilder()
| Method Detail |
|---|
public void addDTDGrammar(org.apache.xerces.xni.parser.XMLInputSource source)
throws IOException
source - DTD
IOException - if an I/O errors occurs
public void addDTDGrammar(String publicId,
String systemId,
InputStream input)
throws IOException
You can set the publicId to null, but the systemId must match the name used in the XML file for the DTD.
publicId - public idsystemId - system idinput - DTD
IOException - if an I/O error occurs
public void addDTDGrammar(String resourceName)
throws IOException
The DTD is added by getting the resource using the specified name, and setting the last part of the resource name as the system id, so that this DTD can be found later when validating XML files. This system id must match the system id in the XML file.
resourceName - name of the DTD resource
IOException - if an I/O error occurs
public void addSchemaGrammar(org.apache.xerces.xni.parser.XMLInputSource source)
throws IOException
The schema is later used when the namespace matches one in a XML file
source - schema
IOException - if an I/O errors occurs
public void addSchemaGrammar(String publicId,
String systemId,
InputStream input)
throws IOException
The schema is later used when the namespace matches one in a XML file The public id and system id can both be null.
publicId - public idsystemId - system idinput - schema
IOException - if an I/O error occurs
public void addSchemaGrammar(InputStream input)
throws IOException
The schema is later used when the namespace matches one in a XML file
input - schema
IOException - if an I/O error occurs
public void addSchemaGrammar(String resourceName)
throws IOException
The schema is later used when the namespace matches one in a XML file
resourceName - name of the schema resource
IOException - if an I/O error occurspublic org.apache.xerces.xni.grammars.XMLGrammarPool getGrammarPool()
It might be a good idea to lock the grammar pool after finishing with this builder.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||