public class TLcdXMLEntityResolver extends Object implements EntityResolver, EntityResolver2, ILcdInputStreamFactoryCapable
resolveEntity()
method. This avoids (expensive) lookups of schemas on
remote locations.
Users can additionally register additional cached entities via the registerEntity(String, String)
method.Constructor and Description |
---|
TLcdXMLEntityResolver()
Creates a new entity resolver, initialized with all known schemas in the LuciadLightspeed distribution.
|
TLcdXMLEntityResolver(Map<String,String> aEntityCache)
Creates a new entity resolver, initialized with all known schemas in the LuciadLightspeed distribution,
and the given set of additional entity resources.
|
Modifier and Type | Method and Description |
---|---|
InputSource |
getExternalSubset(String aName,
String aBaseURI) |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used.
|
void |
registerEntity(String aPublicId,
String aSystemId)
Registers a system ID for the given resource, where the resource can be loaded from.
|
InputSource |
resolveEntity(String aPublicId,
String aSystemId) |
InputSource |
resolveEntity(String aName,
String aPublicId,
String aBaseURI,
String aSystemId) |
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory to be used.
|
public TLcdXMLEntityResolver(Map<String,String> aEntityCache)
aEntityCache
- a map containing additional entity resources; the keys are the public ID's
of the resources (e.g. XSD namespaces), the values are the corresponding
system ID's where the resources can be loaded from.public TLcdXMLEntityResolver()
public ILcdInputStreamFactory getInputStreamFactory()
ILcdInputStreamFactoryCapable
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
ILcdInputStreamFactoryCapable
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public void registerEntity(String aPublicId, String aSystemId)
#resolveEntity
, aSystemId
will get precedence over the
system ID that is passed to the resolveEntity
method.aPublicId
- the public ID (e.g. XSD namespace) of the resource.aSystemId
- the system ID where the resource can be loaded from.public InputSource getExternalSubset(String aName, String aBaseURI) throws SAXException, IOException
getExternalSubset
in interface EntityResolver2
SAXException
IOException
public InputSource resolveEntity(String aName, String aPublicId, String aBaseURI, String aSystemId) throws SAXException, IOException
resolveEntity
in interface EntityResolver2
SAXException
IOException
public InputSource resolveEntity(String aPublicId, String aSystemId) throws SAXException, IOException
resolveEntity
in interface EntityResolver
SAXException
IOException