Interface EntityRegistry
-
- All Known Implementing Classes:
DefaultEntityResolver
public interface EntityRegistryInterface used for registering and retrieving PUBLICID to URL mappings.- Since:
- 1.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.net.URL>getRegisteredEntities()Gets a map with the entity IDs that have been registered using theregisterEntityId()method.voidregisterEntityId(java.lang.String publicId, java.net.URL entityURL)Registers the specified URL for the specified public identifier.
-
-
-
Method Detail
-
getRegisteredEntities
java.util.Map<java.lang.String,java.net.URL> getRegisteredEntities()
Gets a map with the entity IDs that have been registered using theregisterEntityId()method.- Returns:
- a map with the registered entity IDs
-
registerEntityId
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 everySYSTEMURI on every processed XML document is local. This implementation provides only basic functionality. If more sophisticated features are required, either callingXMLConfiguration.setDocumentBuilder(DocumentBuilder)to set a customDocumentBuilder(which also can be initialized with a customEntityResolver) or creating a custom entity resolver and registering it with the XMLConfiguration is recommended.- Parameters:
publicId- Public identifier of the Entity to be resolvedentityURL- The URL to use for reading this Entity- Throws:
java.lang.IllegalArgumentException- if the public ID is undefined
-
-