|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.io.DefaultInputResolver
public final class DefaultInputResolver
Static utility class that implements the entity (external DTD subset, external parsed entities) resolution logics.
Method Summary | |
---|---|
static java.io.Reader |
constructOptimizedReader(ReaderConfig cfg,
java.io.InputStream in,
boolean isXml11,
java.lang.String encoding)
|
static WstxInputSource |
resolveEntity(WstxInputSource parent,
java.net.URL pathCtxt,
java.lang.String entityName,
java.lang.String publicId,
java.lang.String systemId,
javax.xml.stream.XMLResolver customResolver,
ReaderConfig cfg,
int xmlVersion)
Basic external resource resolver implementation; usable both with DTD and entity resolution. |
static WstxInputSource |
resolveEntityUsing(WstxInputSource refCtxt,
java.lang.String entityName,
java.lang.String publicId,
java.lang.String systemId,
javax.xml.stream.XMLResolver resolver,
ReaderConfig cfg,
int xmlVersion)
A very simple utility expansion method used generally when the only way to resolve an entity is via passed resolver; and where failing to resolve it is not fatal. |
protected static WstxInputSource |
sourceFrom(WstxInputSource parent,
ReaderConfig cfg,
java.lang.String refName,
int xmlVersion,
java.lang.Object o)
Factory method that accepts various types of Objects, and tries to create a WstxInputSource from it. |
static WstxInputSource |
sourceFromString(WstxInputSource parent,
ReaderConfig cfg,
java.lang.String refName,
int xmlVersion,
java.lang.String refContent)
We have multiple ways to look at what would it mean to get a String as the resolved result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static WstxInputSource resolveEntity(WstxInputSource parent, java.net.URL pathCtxt, java.lang.String entityName, java.lang.String publicId, java.lang.String systemId, javax.xml.stream.XMLResolver customResolver, ReaderConfig cfg, int xmlVersion) throws java.io.IOException, javax.xml.stream.XMLStreamException
parent
- Input source that contains reference to be expanded.pathCtxt
- Reference context to use for resolving path, if
known. If null, reference context of the parent will
be used; and if that is null (which is possible), the
current working directory will be assumed.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.xmlVersion
- Xml version as declared by the main parsed
document. Currently only relevant for checking that XML 1.0 document
does not include XML 1.1 external parsed entities.
If XML_V_UNKNOWN, no checks will be done.customResolver
- Custom resolver to use first for resolution,
if any (may be null).cfg
- Reader configuration object used by the parser that is
resolving the entity
java.io.IOException
javax.xml.stream.XMLStreamException
public static WstxInputSource resolveEntityUsing(WstxInputSource refCtxt, java.lang.String entityName, java.lang.String publicId, java.lang.String systemId, javax.xml.stream.XMLResolver resolver, ReaderConfig cfg, int xmlVersion) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
protected static WstxInputSource sourceFrom(WstxInputSource parent, ReaderConfig cfg, java.lang.String refName, int xmlVersion, java.lang.Object o) throws java.lang.IllegalArgumentException, java.io.IOException, javax.xml.stream.XMLStreamException
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.
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
java.lang.IllegalArgumentException
java.io.IOException
javax.xml.stream.XMLStreamException
public static java.io.Reader constructOptimizedReader(ReaderConfig cfg, java.io.InputStream in, boolean isXml11, java.lang.String encoding) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static WstxInputSource sourceFromString(WstxInputSource parent, ReaderConfig cfg, java.lang.String refName, int xmlVersion, java.lang.String refContent) throws java.io.IOException, javax.xml.stream.XMLStreamException
Note: public to give access for unit tests that need it...
java.io.IOException
javax.xml.stream.XMLStreamException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |