com.ctc.wstx.io
Class DefaultInputResolver

java.lang.Object
  extended bycom.ctc.wstx.io.DefaultInputResolver

public final class DefaultInputResolver
extends java.lang.Object

Static utility class that implements the entity (external DTD subset, external parsed entities) resolution logics.


Method Summary
static WstxInputSource resolveEntity(WstxInputSource refCtxt, java.lang.String entityName, java.lang.String publicId, java.lang.String systemId, javax.xml.stream.XMLResolver customResolver, javax.xml.stream.XMLReporter rep)
          Basic external resource resolver implementation; usable both with DTD and entity resolution.
static WstxInputSource sourceFrom(WstxInputSource parent, java.lang.String refName, java.lang.Object o, javax.xml.stream.XMLReporter rep)
          Factory method that accepts various types of Objects, and tries to create a WstxInputSource from it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resolveEntity

public static WstxInputSource resolveEntity(WstxInputSource refCtxt,
                                            java.lang.String entityName,
                                            java.lang.String publicId,
                                            java.lang.String systemId,
                                            javax.xml.stream.XMLResolver customResolver,
                                            javax.xml.stream.XMLReporter rep)
                                     throws java.io.IOException,
                                            javax.xml.stream.XMLStreamException
Basic external resource resolver implementation; usable both with DTD and entity resolution.

Parameters:
refCtxt - Input context, relative to which reference was made. May be null, if context is not known.
entityName - Name/id of the entity being expanded, if this is an entity expansion; null otherwise (for example, when resolving external subset).
publicId - Public identifier of the resource, if known; null/empty otherwise. Default implementation just ignores the identifier.
systemId - System identifier of the resource. Although interface allows null/empty, default implementation considers this an error.
customResolver - Custom resolver to use first for resolution, if any (may be null).
rep - Report object that can be used to report non-fatal problems that occur during entity source resolution
Returns:
Input source, if entity could be resolved; null if it could not be resolved. In latter case processor may use its own default resolution mechanism.
Throws:
java.io.IOException
javax.xml.stream.XMLStreamException

sourceFrom

public static WstxInputSource sourceFrom(WstxInputSource parent,
                                         java.lang.String refName,
                                         java.lang.Object o,
                                         javax.xml.stream.XMLReporter rep)
                                  throws java.lang.IllegalArgumentException,
                                         java.io.IOException,
                                         WstxException
Factory method that accepts various types of Objects, and tries to create a WstxInputSource from it. Currently it's only called to locate external DTD subsets, when overriding default DOCTYPE declarations; not for entity expansion or for locating the main document entity.

Parameters:
parent - Input source context active when resolving a new "sub-source"; usually the main document source.
refName - Name of the entity to be expanded, if any; may be null (and currently always is)
o - Object that should provide the new input source; non-type safe
Throws:
java.lang.IllegalArgumentException
java.io.IOException
WstxException