public class XMLResourceResolver extends Object implements XMLResolver, EntityResolver, LSResourceResolver
Constructor and Description |
---|
XMLResourceResolver() |
Modifier and Type | Method and Description |
---|---|
static Map |
getEntityMap()
Obtain a read-only view of the current entity map.
|
boolean |
isEntityResolved()
Returns the boolean value to inform id DTD was found in the XML file or not
This is here to avoid validation errors in descriptors that do not have a DOCTYPE declaration.
|
static boolean |
isWarnOnNonFileURLs() |
protected InputStream |
loadResource(ClassLoader loader,
String resource,
boolean trace)
Look for the resource on the given class loader.
|
protected InputStream |
loadResource(String resource,
boolean trace)
Look for the resource on the class loader that loaded this resolver.
|
static void |
registerEntity(String id,
String dtdFileName)
Register the mapping from the public id/system id to the dtd/xsd file
name.
|
void |
registerLocalEntity(String id,
String dtdOrSchema)
Register the mapping from the public id/system id to the dtd/xsd file
name.
|
protected InputSource |
resolveClasspathName(String systemId,
boolean trace)
Resolve the systemId as a classpath resource.
|
InputSource |
resolveEntity(String publicId,
String systemId)
Returns DTD/Schema inputSource.
|
Object |
resolveEntity(String publicID,
String systemID,
String baseURI,
String namespace) |
protected InputSource |
resolvePublicID(String publicId,
boolean trace)
Load the schema from the class entity to schema file mapping.
|
LSInput |
resolveResource(String type,
String namespaceURI,
String publicID,
String systemID,
String baseURI) |
protected InputSource |
resolveSystemID(String systemId,
boolean trace)
Attempt to use the systemId as a URL from which the schema can be read.
|
protected InputSource |
resolveSystemIDasURL(String systemId,
boolean trace)
Attempt to use the systemId as a URL from which the schema can be read.
|
static void |
setWarnOnNonFileURLs(boolean warnOnNonFileURLs) |
public static Map getEntityMap()
public static boolean isWarnOnNonFileURLs()
public static void setWarnOnNonFileURLs(boolean warnOnNonFileURLs)
public static void registerEntity(String id, String dtdFileName)
id
- the DOCTYPE public id or system id such as
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"dtdFileName
- the simple dtd/xsd file name, "ejb-jar.dtd"public void registerLocalEntity(String id, String dtdOrSchema)
id
- the DOCTYPE public id or system id such as
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"dtdOrSchema
- the simple dtd/xsd file name, "ejb-jar.dtd"public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
resolveEntity
in interface EntityResolver
publicId
- - Public ID of DTD, or null if it is a schemasystemId
- - the system ID of DTD or SchemaSAXException
IOException
public boolean isEntityResolved()
protected InputSource resolvePublicID(String publicId, boolean trace)
publicId
- - the public entity name of the schematrace
- - trace level logging flagregisterEntity(String, String)
protected InputSource resolveSystemID(String systemId, boolean trace)
systemId
- - the systemIdtrace
- - trace level logging flagprotected InputSource resolveSystemIDasURL(String systemId, boolean trace)
systemId
- - the systemIdtrace
- - trace level logging flagprotected InputSource resolveClasspathName(String systemId, boolean trace)
systemId
- - the system ID of DTD or Schematrace
- - trace level logging flagprotected InputStream loadResource(String resource, boolean trace)
resource
- - the classpath resource name of the schematrace
- - trace level logging flagprotected InputStream loadResource(ClassLoader loader, String resource, boolean trace)
resource
- - the classpath resource name of the schematrace
- - trace level logging flagpublic Object resolveEntity(String publicID, String systemID, String baseURI, String namespace) throws XMLStreamException
resolveEntity
in interface XMLResolver
XMLStreamException
public LSInput resolveResource(String type, String namespaceURI, String publicID, String systemID, String baseURI)
resolveResource
in interface LSResourceResolver
Copyright © 2019 JBoss, a division of Red Hat, Inc.. All Rights Reserved.