XMLResolver (Java Platform SE 6) (original) (raw)



javax.xml.stream

Interface XMLResolver


public interface XMLResolver

This interface is used to resolve resources during an XML parse. If an application wishes to perform custom entity resolution it must register an instance of this interface with the XMLInputFactory using the setXMLResolver method.

Since:

1.6


Method Summary
Object [resolveEntity](../../../javax/xml/stream/XMLResolver.html#resolveEntity%28java.lang.String, java.lang.String, java.lang.String, java.lang.String%29)(String publicID,String systemID,String baseURI,String namespace) Retrieves a resource.
Method Detail

resolveEntity

Object resolveEntity(String publicID, String systemID, String baseURI, String namespace) throws XMLStreamException

Retrieves a resource. This resource can be of the following three return types: (1) java.io.InputStream (2) javax.xml.stream.XMLStreamReader (3) java.xml.stream.XMLEventReader. If this method returns null the processor will attempt to resolve the entity using its default mechanism.

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.

baseURI - Absolute base URI associated with systemId.

namespace - The namespace of the entity to resolve.

Returns:

The resource requested or null.

Throws:

[XMLStreamException](../../../javax/xml/stream/XMLStreamException.html "class in javax.xml.stream") - if there was a failure attempting to resolve the resource.



Submit a bug or feature
For further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

Scripting on this page tracks web page traffic, but does not change the content in any way.