|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.configuration.resolver.DefaultEntityResolver
public class DefaultEntityResolver
The DefaultEntityResolver used by XML Configurations.
Constructor Summary | |
---|---|
DefaultEntityResolver()
|
Method Summary | |
---|---|
java.util.Map |
getRegisteredEntities()
Returns a map with the entity IDs that have been registered using the registerEntityId() method. |
void |
registerEntityId(java.lang.String publicId,
java.net.URL entityURL)
Registers the specified URL for the specified public identifier. |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Resolves the requested external entity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultEntityResolver()
Method Detail |
---|
public void registerEntityId(java.lang.String publicId, java.net.URL entityURL)
Registers the specified URL for the specified public identifier.
This implementation maps PUBLICID
's to URLs (from which
the resource will be loaded). A common use case for this method is to
register local URLs (possibly computed at runtime by a class loader) for
DTDs and Schemas. This allows the performance advantage of using a local
version without having to ensure every SYSTEM
URI on every
processed XML document is local. This implementation provides only basic
functionality. If more sophisticated features are required, either calling
XMLConfiguration.setDocumentBuilder(DocumentBuilder)
to set a custom
DocumentBuilder
(which also can be initialized with a
custom EntityResolver
) or creating a custom entity resolver
and registering it with the XMLConfiguration is recommended.
registerEntityId
in interface EntityRegistry
publicId
- Public identifier of the Entity to be resolvedentityURL
- The URL to use for reading this Entity
java.lang.IllegalArgumentException
- if the public ID is undefinedpublic org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
EntityResolver
interface. It checks
the passed in public ID against the registered entity IDs and uses a
local URL if possible.
resolveEntity
in interface org.xml.sax.EntityResolver
publicId
- the public identifier of the entity being referencedsystemId
- the system identifier of the entity being referenced
org.xml.sax.SAXException
- if a parsing exception occurspublic java.util.Map getRegisteredEntities()
registerEntityId()
method.
getRegisteredEntities
in interface EntityRegistry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |