Module java.xml
Package javax.xml.catalog

## Interface CatalogResolver

All Superinterfaces:
  EntityResolver

    public interface CatalogResolver
    extends EntityResolver

A SAX EntityResolver that uses catalogs to resolve references.

Since:
  9

### Method Summary

All Methods Instance Methods Abstract Methods
`InputSource` `resolveEntity(String publicId, String systemId)` The method searches through the catalog entries in the main and alternative catalogs to attempt to find a match with the specified publicId or systemId.

### Method Detail

#### resolveEntity

    InputSource resolveEntity(String publicId,
                              String systemId)

The method searches through the catalog entries in the main and alternative catalogs to attempt to find a match with the specified publicId or systemId.

For resolving external entities, system entries will be matched before the public entries.

The `prefer` attribute: if the `prefer` is public, and there is no match found through the system entries, public entries will be considered. If it is not specified, the `prefer` is public by default (Note that by the OASIS standard, system entries will always be considered first when the external system identifier is specified. Prefer public means that public entries will be matched when both system and public identifiers are specified. In general therefore, prefer public is recommended.)

Specified by:
  `resolveEntity` in interface `EntityResolver`
Parameters:
  `publicId` - the public identifier of the external entity being referenced, or null if none was supplied
  `systemId` - the system identifier of the external entity being referenced. A system identifier is required on all external entities. XML requires a system identifier on all external entities, so this value is always specified.
Returns:
  a `InputSource` object if a mapping is found. If no mapping is found, returns a `InputSource` object containing an empty `Reader` if the `javax.xml.catalog.resolve` property is set to `ignore`; returns null if the `javax.xml.catalog.resolve` property is set to `continue`.
Throws:
  `CatalogException` - if no mapping is found and `javax.xml.catalog.resolve` is specified as strict
See Also:
  `InputSource`