本文整理汇总了Java中org.apache.xerces.util.SymbolTable类的典型用法代码示例。如果您正苦于以下问题:Java SymbolTable类的具体用法?Java SymbolTable怎么用?Java SymbolTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SymbolTable类属于org.apache.xerces.util包,在下文中一共展示了SymbolTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ValidatorImpl
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
ValidatorImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool, PropertyMap properties) {
this.symbolTable = symbolTable;
XMLErrorHandler errorHandlerWrapper = new ErrorHandlerWrapper(properties.get(ValidateProperty.ERROR_HANDLER));
components = new XMLComponent[] { errorReporter, schemaValidator, entityManager };
for (int i = 0; i < components.length; i++) {
addRecognizedFeatures(components[i].getRecognizedFeatures());
addRecognizedProperties(components[i].getRecognizedProperties());
}
addRecognizedFeatures(recognizedFeatures);
addRecognizedProperties(recognizedProperties);
setFeature(Features.SCHEMA_AUGMENT_PSVI, false);
setFeature(Features.SCHEMA_FULL_CHECKING, true);
setFeature(Features.VALIDATION, true);
setFeature(Features.SCHEMA_VALIDATION, true);
setFeature(Features.ID_IDREF_CHECKING, true);
setFeature(Features.IDC_CHECKING, true);
setProperty(Properties.XMLGRAMMAR_POOL, grammarPool);
setProperty(Properties.SYMBOL_TABLE, symbolTable);
errorReporter.setDocumentLocator(this);
setProperty(Properties.ERROR_REPORTER, errorReporter);
setProperty(Properties.ERROR_HANDLER, errorHandlerWrapper);
setProperty(Properties.VALIDATION_MANAGER, validationManager);
setProperty(Properties.ENTITY_MANAGER, entityManager);
setProperty(Properties.ENTITY_RESOLVER, this);
reset();
}
示例2: SAXParserMMImpl
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Constructs a SAX parser using the specified symbol table and
* grammar pool.
*/
public SAXParserMMImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
// modified by rsun 11/06/03 - use XML11ConfigurationMMImpl instead
// of XML11ConfigurationImpl
super((XMLParserConfiguration)ObjectFactory.createObject(
"org.apache.xerces.xni.parser.XMLParserConfiguration",
"org.apache.xerces.parsers.XML11ConfigurationMMImpl"
));
// set features
fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES);
fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true);
// set properties
fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
if (symbolTable != null) {
fConfiguration.setProperty(SYMBOL_TABLE, symbolTable);
}
if (grammarPool != null) {
fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
}
}
示例3: SAXParser
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Constructs a SAX parser using the specified symbol table and
* grammar pool.
*/
public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
super((XMLParserConfiguration)ObjectFactory.createObject(
"org.apache.xerces.xni.parser.XMLParserConfiguration",
"org.apache.xerces.parsers.XIncludeAwareParserConfiguration"
));
// set features
fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES);
fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true);
// set properties
fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
if (symbolTable != null) {
fConfiguration.setProperty(SYMBOL_TABLE, symbolTable);
}
if (grammarPool != null) {
fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
}
}
示例4: DOMParser
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Constructs a DOM parser using the specified symbol table and
* grammar pool.
*/
public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
super((XMLParserConfiguration)ObjectFactory.createObject(
"org.apache.xerces.xni.parser.XMLParserConfiguration",
"org.apache.xerces.parsers.XIncludeAwareParserConfiguration"
));
// set properties
fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
if (symbolTable != null) {
fConfiguration.setProperty(SYMBOL_TABLE, symbolTable);
}
if (grammarPool != null) {
fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
}
}
示例5: XMLGrammarCachingConfiguration
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Constructs a parser configuration using the specified symbol table,
* grammar pool, and parent settings.
* <p>
* <strong>REVISIT:</strong>
* Grammar pool will be updated when the new validation engine is
* implemented.
*
* @param symbolTable The symbol table to use.
* @param grammarPool The grammar pool to use.
* @param parentSettings The parent settings.
*/
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
XMLGrammarPool grammarPool,
XMLComponentManager parentSettings) {
super(symbolTable, grammarPool, parentSettings);
// REVISIT: may need to add some features/properties
// specific to this configuration at some point...
// add default recognized features
// set state for default features
// add default recognized properties
// create and register missing components
fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);
// and set up the DTD loader too:
fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
示例6: setProperty
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Sets the value of a property during parsing.
*
* @param propertyId
* @param value
*/
public void setProperty(String propertyId, Object value)
throws XMLConfigurationException {
// Xerces properties
if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
if (suffixLength == Constants.SYMBOL_TABLE_PROPERTY.length() &&
propertyId.endsWith(Constants.SYMBOL_TABLE_PROPERTY)) {
fSymbolTable = (SymbolTable)value;
}
else if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() &&
propertyId.endsWith(Constants.ERROR_REPORTER_PROPERTY)) {
fErrorReporter = (XMLErrorReporter)value;
}
else if (suffixLength == Constants.ENTITY_MANAGER_PROPERTY.length() &&
propertyId.endsWith(Constants.ENTITY_MANAGER_PROPERTY)) {
fEntityManager = (XMLEntityManager)value;
}
}
}
示例7: reset
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Resets the component. The component can query the component manager
* about any features and properties that affect the operation of the
* component.
*
* @param componentManager The component manager.
*
* @throws SAXException Thrown by component on initialization error.
* For example, if a feature or property is
* required for the operation of the component, the
* component manager may throw a
* SAXNotRecognizedException or a
* SAXNotSupportedException.
*/
public void reset(XMLComponentManager componentManager)
throws XNIException {
// features
try {
fNamespaces = componentManager.getFeature(NAMESPACES);
}
catch (XMLConfigurationException e) {
fNamespaces = true;
}
// Xerces properties
fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
}
示例8: setProperty
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Sets the value of a property during parsing.
*
* @param propertyId
* @param value
*/
public void setProperty(String propertyId, Object value)
throws XMLConfigurationException {
// Xerces properties
if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
if (suffixLength == Constants.SYMBOL_TABLE_PROPERTY.length() &&
propertyId.endsWith(Constants.SYMBOL_TABLE_PROPERTY)) {
fSymbolTable = (SymbolTable)value;
}
else if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() &&
propertyId.endsWith(Constants.ERROR_REPORTER_PROPERTY)) {
fErrorReporter = (XMLErrorReporter)value;
}
return;
}
}
示例9: XPath
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/** Constructs a field XPath expression. */
public XPath(String xpath,
SymbolTable symbolTable,
NamespaceContext context) throws XPathException {
super(fixupXPath(xpath), symbolTable, context);
// verify that only one attribute is selected per branch
for (int i=0;i<fLocationPaths.length;i++) {
for(int j=0; j<fLocationPaths[i].steps.length; j++) {
org.apache.xerces.impl.xpath.XPath.Axis axis =
fLocationPaths[i].steps[j].axis;
if (axis.type == XPath.Axis.ATTRIBUTE &&
(j < fLocationPaths[i].steps.length-1)) {
throw new XPathException("c-fields-xpaths");
}
}
}
}
示例10: main
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/** Main program entry. */
public static void main(String[] argv) throws Exception {
for (int i = 0; i < argv.length; i++) {
final String expression = argv[i];
System.out.println("# XPath expression: \""+expression+'"');
try {
SymbolTable symbolTable = new SymbolTable();
XPath xpath = new XPath(expression, symbolTable, null);
System.out.println("expanded xpath: \""+xpath.toString()+'"');
}
catch (XPathException e) {
System.out.println("error: "+e.getMessage());
}
}
}
示例11: SchemaImpl
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
SchemaImpl(SymbolTable symbolTable,
XMLGrammarPool grammarPool,
PropertyMap properties,
PropertyId<?>[] supportedPropertyIds) {
super(properties, supportedPropertyIds);
this.symbolTable = symbolTable;
this.grammarPool = grammarPool;
}
示例12: createSchema
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
public Schema createSchema(SAXSource source, PropertyMap properties)
throws IOException, SAXException, IncorrectSchemaException {
SymbolTable symbolTable = new SymbolTable();
XMLGrammarPreparser preparser = new XMLGrammarPreparser(symbolTable);
XMLGrammarPool grammarPool = new XMLGrammarPoolImpl();
preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
preparser.setGrammarPool(grammarPool);
ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
SAXXMLErrorHandler xeh = new SAXXMLErrorHandler(eh);
preparser.setErrorHandler(xeh);
EntityResolver er = properties.get(ValidateProperty.ENTITY_RESOLVER);
if (er != null)
preparser.setEntityResolver(new EntityResolverWrapper(er));
try {
preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, toXMLInputSource(source.getInputSource()));
Name attributeOwner = properties.get(WrapProperty.ATTRIBUTE_OWNER);
if (attributeOwner != null) {
Reader r = new StringReader(createWrapper(attributeOwner));
preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA,
new XMLInputSource(null, null, null, r, null));
}
}
catch (XNIException e) {
throw ValidatorImpl.toSAXException(e);
}
if (xeh.getHadError())
throw new IncorrectSchemaException();
return new SchemaImpl(new SynchronizedSymbolTable(symbolTable),
new CachingParserPool.SynchronizedGrammarPool(grammarPool),
properties,
supportedPropertyIds);
}
示例13: IntegratedParserConfigurationMMImpl
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Constructs a parser configuration using the specified symbol table,
* grammar pool, and parent settings.
* <p>
* <strong>REVISIT:</strong>
* Grammar pool will be updated when the new validation engine is
* implemented.
*
* @param symbolTable The symbol table to use.
* @param grammarPool The grammar pool to use.
* @param parentSettings The parent settings.
*/
public IntegratedParserConfigurationMMImpl(SymbolTable symbolTable,
XMLGrammarPool grammarPool,
XMLComponentManager parentSettings) {
super(symbolTable, grammarPool, parentSettings);
// create components
fNonNSScanner = new XMLDocumentScannerImpl();
fNonNSDTDValidator = new XMLDTDValidator();
// add components
addComponent((XMLComponent)fNonNSScanner);
addComponent((XMLComponent)fNonNSDTDValidator);
}
示例14: XPointerParserConfiguration
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
* Constructs a parser configuration using the specified symbol table,
* grammar pool, and parent settings.
* <p>
*
* @param symbolTable The symbol table to use.
* @param grammarPool The grammar pool to use.
* @param parentSettings The parent settings.
*/
public XPointerParserConfiguration(
SymbolTable symbolTable,
XMLGrammarPool grammarPool,
XMLComponentManager parentSettings) {
super(symbolTable, grammarPool, parentSettings);
fXIncludeHandler = new XIncludeHandler();
addCommonComponent(fXIncludeHandler);
fXPointerHandler = new XPointerHandler();
addCommonComponent(fXPointerHandler);
final String[] recognizedFeatures = {
ALLOW_UE_AND_NOTATION_EVENTS,
XINCLUDE_FIXUP_BASE_URIS,
XINCLUDE_FIXUP_LANGUAGE
};
addRecognizedFeatures(recognizedFeatures);
// add default recognized properties
final String[] recognizedProperties =
{ XINCLUDE_HANDLER, XPOINTER_HANDLER, NAMESPACE_CONTEXT };
addRecognizedProperties(recognizedProperties);
setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
setProperty(XPOINTER_HANDLER, fXPointerHandler);
setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
}
示例15: XPointerHandler
import org.apache.xerces.util.SymbolTable; //导入依赖的package包/类
/**
*
*/
public XPointerHandler() {
super();
fXPointerParts = new ArrayList();
fSymbolTable = new SymbolTable();
}