Class ParserEntityResolver
- java.lang.Object
-
- org.pentaho.reporting.libraries.xmlns.parser.ParserEntityResolver
-
- All Implemented Interfaces:
org.xml.sax.EntityResolver
public final class ParserEntityResolver extends java.lang.Object implements org.xml.sax.EntityResolverResolves the JFreeReport DTD specification and routes the parser to a local copy.- Author:
- Thomas Morgner
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ParserEntityResolvergetDefaultResolver()Returns a default resolver, which is initialized to redirect the parser to a local copy of the JFreeReport DTDs.java.lang.StringgetDeprecatedDTDMessage(java.lang.String publicID)Returns deprecation message for the given public ID.java.net.URLgetDTDLocation(java.lang.String publicID)Sets the location of the DTD.org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, java.lang.String systemId)Allow the application to resolve external entities.voidsetDeprecatedDTDMessage(java.lang.String publicID, java.lang.String message)Defines that the given public ID should be deprecated and provides a log-message along with the deprecation.booleansetDTDLocation(java.lang.String publicID, java.lang.String systemId, java.net.URL location)Defines a DTD used to validate the report definition.booleansetDTDLocation(java.lang.String publicID, java.net.URL location)Defines a DTD used to validate the report definition.
-
-
-
Method Detail
-
setDTDLocation
public boolean setDTDLocation(java.lang.String publicID, java.net.URL location)Defines a DTD used to validate the report definition. Your XMLParser must be a validating parser for this feature to work.- Parameters:
publicID- the public ID.location- the URL.- Returns:
- A boolean.
-
setDTDLocation
public boolean setDTDLocation(java.lang.String publicID, java.lang.String systemId, java.net.URL location)Defines a DTD used to validate the report definition. Your XMLParser must be a validating parser for this feature to work.- Parameters:
systemId- the system ID for the DTD.publicID- the public ID.location- the URL.- Returns:
- A boolean.
-
getDTDLocation
public java.net.URL getDTDLocation(java.lang.String publicID)
Sets the location of the DTD. This is used for validating XML parsers to validate the structure of the report definition.- Parameters:
publicID- the id.- Returns:
- the URL for the DTD.
-
resolveEntity
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)Allow the application to resolve external entities. Resolves the DTD definition to point to a local copy, if the specified public ID is known to this resolver.- Specified by:
resolveEntityin interfaceorg.xml.sax.EntityResolver- Parameters:
publicId- the public ID.systemId- the system ID.- Returns:
- The input source.
-
getDefaultResolver
public static ParserEntityResolver getDefaultResolver()
Returns a default resolver, which is initialized to redirect the parser to a local copy of the JFreeReport DTDs.- Returns:
- the default entity resolver.
-
setDeprecatedDTDMessage
public void setDeprecatedDTDMessage(java.lang.String publicID, java.lang.String message)Defines that the given public ID should be deprecated and provides a log-message along with the deprecation.- Parameters:
publicID- the public id that should be considered deprecated.message- the message to present to the user to warn them about their use of deprecated DTDs.
-
getDeprecatedDTDMessage
public java.lang.String getDeprecatedDTDMessage(java.lang.String publicID)
Returns deprecation message for the given public ID.- Parameters:
publicID- the public id that should be considered deprecated.- Returns:
- the deprecation message or null if the ID is not considered deprecated.
-
-