|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XSDSchemaLocationResolver
An adapter interface used to resolve schema locations
.
When the schema location of an schema directive needs to be resolved,
each containing schema
will be inspected
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; } });
EcoreUtil.getRegisteredAdapter(org.eclipse.emf.ecore.EObject,Object)
Method Summary | |
---|---|
java.lang.String |
resolveSchemaLocation(XSDSchema xsdSchema,
java.lang.String namespaceURI,
java.lang.String schemaLocationURI)
Resolve the namespace and schema location relative to the given base schema's location. |
Method Detail |
---|
java.lang.String resolveSchemaLocation(XSDSchema xsdSchema, java.lang.String namespaceURI, java.lang.String schemaLocationURI)
resolveSchemaLocation (xsdSchema, // xsdSchema.getSchemaLocation() == "http://www.example.com/A/a.xsd" "http://www.example.com/B", "../B/b.xsd");would normally yield
"http://www.example.com/B/b.xsd"When no namespace schema location is provided, the namespace itself will be used.
xsdSchema
- the schema containing the referencenamespaceURI
- the namespace being resolved, i.e., XSDImport.getNamespace()
.schemaLocationURI
- the suggested location of the namespace being resolved, i.e., XSDSchemaDirective.getSchemaLocation()
.
XSDConstants.resolveSchemaLocation(String,String,String)
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |