Class XMLFileAssociationResolverExtension
- java.lang.Object
-
- org.eclipse.lemminx.extensions.contentmodel.uriresolver.XMLFileAssociationResolverExtension
-
- All Implemented Interfaces:
org.apache.xerces.xni.parser.XMLEntityResolver,IExternalGrammarLocationProvider,URIResolverExtension
public class XMLFileAssociationResolverExtension extends Object implements URIResolverExtension, IExternalGrammarLocationProvider
XML file association URI resolver.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.lemminx.uriresolver.IExternalGrammarLocationProvider
DOCTYPE, NO_NAMESPACE_SCHEMA_LOCATION, RELAXNG, SCHEMA_LOCATION
-
Fields inherited from interface org.eclipse.lemminx.uriresolver.URIResolverExtension
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description XMLFileAssociationResolverExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>getExternalGrammarLocation(URI fileURI)Provided the file path URI, this will return the external schema location.StringgetName()Stringresolve(String baseLocation, String publicId, String systemId)booleansetFileAssociations(XMLFileAssociation[] fileAssociations)voidsetRootUri(String rootUri)Set the root URI-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.lemminx.uriresolver.URIResolverExtension
resolveEntity
-
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceURIResolverExtension
-
setFileAssociations
public boolean setFileAssociations(XMLFileAssociation[] fileAssociations)
- Parameters:
fileAssociations-- Returns:
- true if file associations changed and false otherwise
-
resolve
public String resolve(String baseLocation, String publicId, String systemId)
- Specified by:
resolvein interfaceURIResolverExtension- Parameters:
baseLocation- - the location of the resource that contains the uripublicId- - an optional public identifier (i.e. namespace name), or null if nonesystemId- - an absolute or relative URI, or null if none- Returns:
- an absolute URI representation of the 'logical' location of the resource
-
getExternalGrammarLocation
public Map<String,String> getExternalGrammarLocation(URI fileURI)
Description copied from interface:IExternalGrammarLocationProviderProvided the file path URI, this will return the external schema location. The schema location is associated to a specific property, which serves as the key in the map. The supported properties are:http://apache.org/xml/properties/schema/external-schemaLocation - The value for this property follows the same rules as the schemaLocation attribute for an XML document (i.e., multiple schemas are acceptable and must be white-space separated).
http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation - The value for this property follows the same rules as the noNamespaceSchemaLocation attribute for an XML document (i.e., only one schema is allowed).
- Specified by:
getExternalGrammarLocationin interfaceIExternalGrammarLocationProvider- Returns:
- a
Mapassociating the external-schemaLocation and/or external-noNamespaceSchemaLocation to the schema location
-
setRootUri
public void setRootUri(String rootUri)
Set the root URI- Parameters:
rootUri- the root URI
-
-