本文整理了Java中org.eclipse.xsd.util.XSDSchemaLocationResolver
类的一些代码示例,展示了XSDSchemaLocationResolver
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDSchemaLocationResolver
类的具体详情如下:
包路径:org.eclipse.xsd.util.XSDSchemaLocationResolver
类名称:XSDSchemaLocationResolver
[英]An adapter interface used to resolve org.eclipse.xsd.XSDSchemaDirective#getSchemaLocation. When the schema location of an schema directive needs to be resolved, each containing org.eclipse.xsd.XSDSchema will be org.eclipse.emf.ecore.util.EcoreUtil#getRegisteredAdapter(org.eclipse.emf.ecore.EObject,Object) for an adapter that implements this interface. As such, you can register an adapter factory like this to tailor the algorithm used to resolve a schema location:
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getAdapterFactories().add
(new AdapterFactoryImpl()
{
class Resolver extends AdapterImpl implements XSDSchemaLocationResolver
{
public String resolveSchemaLocation(XSDSchema xsdSchema, String namespaceURI, String schemaLocationURI)
{
return XSDConstants.resolveSchemaLocation(xsdSchema.getSchemaLocation(), namespaceURI, schemaLocationURI);
}
public boolean isAdapterForType(Object type)
{
return type == XSDSchemaLocationResolver.class;
}
}
protected Resolver resolver = new Resolver();
public boolean isFactoryForType(Object type)
{
return type == XSDSchemaLocationResolver.class;
}
public Adapter adaptNew(Notifier target, Object type)
{
return resolver;
}
});
[中]用于解析组织的适配器接口。日食xsd。XSDSchemaDirective#getSchemaLocation。当需要解析schema指令的schema位置时,每个指令都包含org。日食xsd。XSDSchema将被组织起来。日食电动势。ecore。util。EcoreUtil#getRegisteredAdapter(org.eclipse.emf.ecore.EObject,Object),用于实现此接口的适配器。因此,您可以像这样注册适配器工厂,以定制用于解析架构位置的算法:
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getAdapterFactories().add
(new AdapterFactoryImpl()
{
class Resolver extends AdapterImpl implements XSDSchemaLocationResolver
{
public String resolveSchemaLocation(XSDSchema xsdSchema, String namespaceURI, String schemaLocationURI)
{
return XSDConstants.resolveSchemaLocation(xsdSchema.getSchemaLocation(), namespaceURI, schemaLocationURI);
}
public boolean isAdapterForType(Object type)
{
return type == XSDSchemaLocationResolver.class;
}
}
protected Resolver resolver = new Resolver();
public boolean isFactoryForType(Object type)
{
return type == XSDSchemaLocationResolver.class;
}
public Adapter adaptNew(Notifier target, Object type)
{
return resolver;
}
});
代码示例来源:origin: geotools/geotools
public String resolveSchemaLocation(
XSDSchema schema, String namespaceURI, String rawSchemaLocationURI) {
for (int i = 0; i < resolvers.size(); i++) {
XSDSchemaLocationResolver resolver = (XSDSchemaLocationResolver) resolvers.get(i);
String resolved =
resolver.resolveSchemaLocation(schema, namespaceURI, rawSchemaLocationURI);
if (resolved != null) {
return resolved;
}
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(
"Could not resolve schema location: "
+ rawSchemaLocationURI
+ " to physical location.");
}
return null;
}
}
代码示例来源:origin: geotools/geotools
resolver.resolveSchemaLocation(null, namespace, location);
if (resolvedSchemaLocation != null) {
return resolvedSchemaLocation;
代码示例来源:origin: geotools/geotools
resolvers.get(j).resolveSchemaLocation(null, namespace, location);
if (override != null) {
代码示例来源:origin: org.geotools/gt2-xml-core
public String resolveSchemaLocation(XSDSchema schema, String namespaceURI,
String rawSchemaLocationURI) {
for (int i = 0; i < resolvers.size(); i++) {
XSDSchemaLocationResolver resolver = (XSDSchemaLocationResolver) resolvers.get(i);
String resolved = resolver.resolveSchemaLocation(schema, namespaceURI,
rawSchemaLocationURI);
if (resolved != null) {
return resolved;
}
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Could not resolve schema location: " + rawSchemaLocationURI
+ " to physical location.");
}
return null;
}
}
代码示例来源:origin: org.geotools.xsd/gt-core
public String resolveSchemaLocation(XSDSchema schema, String namespaceURI,
String rawSchemaLocationURI) {
for (int i = 0; i < resolvers.size(); i++) {
XSDSchemaLocationResolver resolver = (XSDSchemaLocationResolver) resolvers.get(i);
String resolved = resolver.resolveSchemaLocation(schema, namespaceURI,
rawSchemaLocationURI);
if (resolved != null) {
return resolved;
}
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Could not resolve schema location: " + rawSchemaLocationURI
+ " to physical location.");
}
return null;
}
}
代码示例来源:origin: org.geotools/gt2-xml-xsd
public String resolveSchemaLocation(
XSDSchema schema, String namespaceURI, String rawSchemaLocationURI
) {
for (int i = 0; i < resolvers.size(); i++) {
XSDSchemaLocationResolver resolver = (XSDSchemaLocationResolver) resolvers.get( i );
String resolved =
resolver.resolveSchemaLocation(schema, namespaceURI, rawSchemaLocationURI);
if (resolved != null) {
return resolved;
}
}
if (rawSchemaLocationURI != null || rawSchemaLocationURI.startsWith("http://")
|| rawSchemaLocationURI.startsWith("file:")) {
LOGGER.warning("Using the provided absolute URI as the location for namespace '"
+ namespaceURI
+ "', as it couldn't be resolved for the provided location path '"
+ rawSchemaLocationURI + "'");
return rawSchemaLocationURI;
}
LOGGER.warning( "Could not resolve schema location: " + rawSchemaLocationURI + " to physical location." );
return null;
}
}
代码示例来源:origin: org.geotools/gt2-xml-gml3
/**
* @return Url to the gml.xsd file of the gml3 schema.
*/
public String getSchemaFileURL() {
return getSchemaLocationResolver().resolveSchemaLocation(null, getNamespaceURI(), "gml.xsd");
}
代码示例来源:origin: org.geoserver/wfsv
/**
* @return the uri to the the wfsv.xsd .
* @generated
*/
public String getSchemaFileURL() {
return getSchemaLocationResolver().resolveSchemaLocation(null, getNamespaceURI(), "wfsv.xsd");
}
代码示例来源:origin: org.geotools/gt2-xml-xsd
/**
* @return The xlinks.xsd of the xlink schema.
*/
public String getSchemaFileURL() {
return getSchemaLocationResolver().resolveSchemaLocation( null, getNamespaceURI(), "xlinks.xsd" );
}
代码示例来源:origin: org.geotools.xsd/gt-core
resolver.resolveSchemaLocation(null, namespace, location );
if ( resolvedSchemaLocation != null ) {
return resolvedSchemaLocation;
代码示例来源:origin: org.geotools/gt2-xml-gml3
/**
* @return URL to smil20-language.xsd file of schema.
*/
public String getSchemaFileURL() {
return getSchemaLocationResolver()
.resolveSchemaLocation(null, getNamespaceURI(), "smil20-language.xsd");
}
代码示例来源:origin: org.geotools/gt2-wms
/**
* @return the uri to the the WMS_MS_Capabilitiesr2.xsd .
* @generated
*/
public String getSchemaFileURL() {
return getSchemaLocationResolver().resolveSchemaLocation(
null, getNamespaceURI(), "WMS_MS_Capabilities.xsd"
);
}
代码示例来源:origin: org.geotools/gt2-xml-filter
/**
* @return the filter.xsd file of the schema.
*/
public String getSchemaFileURL() {
return getSchemaLocationResolver()
.resolveSchemaLocation(null, getNamespaceURI(), "filter.xsd");
}
代码示例来源:origin: org.geotools/gt2-xml-filter
/**
* @return the filter.xsd file of the schema.
*/
public String getSchemaFileURL() {
return getSchemaLocationResolver()
.resolveSchemaLocation(null, getNamespaceURI(), "filter.xsd");
}
代码示例来源:origin: org.geotools/gt2-xml-gml3
/**
* @return URL to smil20.xsd file of schema.
*/
public String getSchemaFileURL() {
return getSchemaLocationResolver()
.resolveSchemaLocation(null, getNamespaceURI(), "smil20.xsd");
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
if (xsdSchemaLocationResolver != null)
return xsdSchemaLocationResolver.resolveSchemaLocation(xsdSchema, namespace, schemaLocation);
代码示例来源:origin: org.eclipse/org.eclipse.xsd
if (xsdSchemaLocationResolver != null)
return xsdSchemaLocationResolver.resolveSchemaLocation(xsdSchema, namespace, schemaLocation);
代码示例来源:origin: org.geotools/gt2-xml-core
String override = resolvers[j].resolveSchemaLocation(null, namespace,
location);
代码示例来源:origin: org.geotools/gt2-xml-xsd
String override = resolvers[j].resolveSchemaLocation(null,
namespace, location);
代码示例来源:origin: org.geotools.xsd/gt-core
String override = resolvers[j].resolveSchemaLocation(null, namespace,
location);
if (override != null) {
内容来源于网络,如有侵权,请联系作者删除!