|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.common.xml.ClasspathEntityResolver
public class ClasspathEntityResolver
Tries to load external entities from the classpath.
To find the entities in the classpath a mapping file must be specified. The mapping file is located at "META-INF/xml/entity-mapping.properties". The file contains entries structured like this:[publicId|systemId]=path in classpath
e.g.:
http://tempuri.org/test.dtd=META-INF/xml/dtds/test.dtd
Constructor Summary | |
---|---|
ClasspathEntityResolver()
Constructor creates a new instance in quite mode. |
|
ClasspathEntityResolver(boolean quite)
|
|
ClasspathEntityResolver(boolean quite,
ClassLoader loader)
|
Method Summary | |
---|---|
protected InputSource |
createInputSource(String resourcefile)
Method creates an input source for the given resource file. |
protected InputSource |
emptyInputSource()
Method creates an InputSource which points to an empty resource. |
protected String |
getMappedResourceFileName(String identifier)
Method gets the mapped resource file name for the given identifier. |
boolean |
isQuite()
Method gets the quite state. |
protected void |
loadMapping(ClassLoader classloader)
Method loads all entries from the mapping files located at META-INF/xml/entity-mapping.properties. |
InputSource |
resolveEntity(String publicId,
String systemId)
Method resolves an entity by looking in a special mapping file located at "META-INF/xml/entity-mapping.properties". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClasspathEntityResolver()
public ClasspathEntityResolver(boolean quite)
quite
- the quite mode.public ClasspathEntityResolver(boolean quite, ClassLoader loader)
quite
- the quite mode.loader
- the classloader to use, if null this.getClass().getClassLoader() is used.Method Detail |
---|
protected void loadMapping(ClassLoader classloader)
[publicId|systemId]=path in classpath
e.g.:
http://tempuri.org/test.dtd=META-INF/xml/dtds/test.dtd
classloader
- the classloader if null this.getClass().getClassLoader() is used.public boolean isQuite()
public InputSource resolveEntity(String publicId, String systemId)
resolveEntity
in interface EntityResolver
publicId
- the publicId.systemId
- the systemId.
protected InputSource createInputSource(String resourcefile)
resourcefile
- the resourcefile.
protected InputSource emptyInputSource()
protected String getMappedResourceFileName(String identifier)
identifier
- the identifier (e.g. publicId or systemId).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |