本文整理了Java中org.apache.xerces.impl.xs.XMLSchemaLoader.setProperty()
方法的一些代码示例,展示了XMLSchemaLoader.setProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLSchemaLoader.setProperty()
方法的具体详情如下:
包路径:org.apache.xerces.impl.xs.XMLSchemaLoader
类名称:XMLSchemaLoader
方法名:setProperty
[英]Sets the state of a property.
[中]设置属性的状态。
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/**
* No-args constructor.
*/
public XSLoaderImpl() {
fSchemaLoader.setProperty(XMLSchemaLoader.XMLGRAMMAR_POOL, fGrammarPool);
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
/**
* 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);
} // <init>(SymbolTable,XMLGrammarPool, XMLComponentManager)
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
BaseSchemaFactory(String xsdVersion) {
fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
fXMLSchemaLoader.setProperty(XML_SCHEMA_VERSION, xsdVersion);
fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
fXSDVersion = xsdVersion;
fUseGrammarPoolOnly = true;
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
SchemaGrammar parseXMLSchema(XMLInputSource is)
throws IOException {
XMLEntityResolver resolver = getEntityResolver();
if(resolver != null) {
fSchemaLoader.setEntityResolver(resolver);
}
if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
}
fSchemaLoader.setProperty(ERROR_REPORTER, fErrorReporter);
String propPrefix = Constants.XERCES_PROPERTY_PREFIX;
String propName = propPrefix + Constants.SCHEMA_LOCATION;
fSchemaLoader.setProperty(propName, getProperty(propName));
propName = propPrefix + Constants.SCHEMA_NONS_LOCATION;
fSchemaLoader.setProperty(propName, getProperty(propName));
propName = Constants.JAXP_PROPERTY_PREFIX+Constants.SCHEMA_SOURCE;
fSchemaLoader.setProperty(propName, getProperty(propName));
fSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, getFeature(SCHEMA_FULL_CHECKING));
// Should check whether the grammar with this namespace is already in
// the grammar resolver. But since we don't know the target namespace
// of the document here, we leave such check to XSDHandler
SchemaGrammar grammar = (SchemaGrammar)fSchemaLoader.loadGrammar(is);
// by default, hand it off to the grammar pool
if (grammar != null) {
fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA,
new Grammar[]{grammar});
}
return grammar;
} // parseXMLSchema(XMLInputSource) : SchemaGrammar
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
/**
* Get an instance of XSLoader that is capable of
* parsing schema files
*
* @return
*/
public XSLoader getXSLoader()
{
XMLSchemaLoader xsloader = new XMLSchemaLoader();
JBossXSErrorHandler eh = new JBossXSErrorHandler();
xsloader.setErrorHandler(eh);
xsloader.setProperty("http://apache.org/xml/properties/internal/grammar-pool", new XMLGrammarPoolImpl());
return xsloader;
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
/**
* Get an instance of XSLoader that is capable of
* parsing schema files
* @param xeh XML Error handler
* @param xer XML Entity Resolver
* @return
*/
public XSLoader getXSLoader(XMLErrorHandler xeh, XMLEntityResolver xer)
{
XMLSchemaLoader xsloader = new XMLSchemaLoader();
xsloader.setEntityResolver(xer);
xsloader.setErrorHandler(xeh);
xsloader.setProperty("http://apache.org/xml/properties/internal/grammar-pool", new XMLGrammarPoolImpl());
return xsloader;
}
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
fSchemaLoader.setProperty(XML_SCHEMA_VERSION, value);
fSchemaVersion = fSchemaLoader.getSchemaVersion();
fXSConstraints = fSchemaLoader.getXSConstraints();
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
return;
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
return;
fXMLSchemaLoader.setProperty(name, object);
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
setProperty(name, value);
} catch (Exception ex) {
内容来源于网络,如有侵权,请联系作者删除!