Package org.eclipse.lemminx.extensions.contentmodel.uriresolver

## 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
`XMLFileAssociationResolverExtension()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Map<String,​String>` `getExternalGrammarLocation​(URI fileURI)` Provided the file path URI, this will return the external schema location.
`String` `getName()`
`String` `resolve​(String baseLocation, String publicId, String systemId)`
`boolean` `setFileAssociations​(XMLFileAssociation[] fileAssociations)`
`void` `setRootUri​(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`

### Constructor Detail

#### XMLFileAssociationResolverExtension

    public XMLFileAssociationResolverExtension()

### Method Detail

#### getName

    public String getName()

Specified by:
  `getName` in interface `URIResolverExtension`

#### 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:
  `resolve` in interface `URIResolverExtension`
Parameters:
  `baseLocation` - - the location of the resource that contains the uri
  `publicId` - - an optional public identifier (i.e. namespace name), or null if none
  `systemId` - - 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: `IExternalGrammarLocationProvider`
Provided 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:
  `getExternalGrammarLocation` in interface `IExternalGrammarLocationProvider`
Returns:
  a `Map` associating 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