Package com.openhtmltopdf.resource
Class FSEntityResolver
java.lang.Object
com.openhtmltopdf.resource.FSEntityResolver
- All Implemented Interfaces:
EntityResolver
A SAX EntityResolver for common entity references and DTDs in X/HTML processing. Maps official entity references to local copies to avoid network lookup. The local copies are stored in the source tree under /entities, and the references here are resolved by a system ClassLoader. As long as the entity files are in the classpath (or bundled in the FS jar), they will be picked up.
The basic form of this class comes from Elliot Rusty Harold, on http://www.cafeconleche.org/books/xmljava/chapters/ch07s02.html
This class is a Singleton; use instance
to retrieve it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final FSEntityResolver
Singleton instance, useinstance()
to retrieve. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Constructor for the FSEntityResolver object, fill the map of public ids to local urls. -
Method Summary
Modifier and TypeMethodDescriptionReturns an unmodifiable map of entities parsed by this resolver.static FSEntityResolver
instance()
Gets an instance of this class.resolveEntity
(String publicID, String systemID)
-
Field Details
-
instance
Singleton instance, useinstance()
to retrieve. -
entities
-
-
Constructor Details
-
FSEntityResolver
private FSEntityResolver()Constructor for the FSEntityResolver object, fill the map of public ids to local urls.
-
-
Method Details
-
resolveEntity
- Specified by:
resolveEntity
in interfaceEntityResolver
-
instance
Gets an instance of this class.- Returns:
- An instance of FSEntityResolver.
-
getEntities
Returns an unmodifiable map of entities parsed by this resolver.- Returns:
- an unmodifiable map of entities parsed by this resolver.
-