|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.ResourceResolver
public class ResourceResolver
ResourceResolver is a URIResolver for XSL transformation.
Its purpose is to catch the XSL document(...) function call and return a
valid data source only if the wanted resource is present in the project
resources.
The main goal of ResourceResolver is to retrieve datasources locally, if the
wanted resource is not present in project resource then null will be
returned.
The resolve function search for the file part of href parameter:
href: http://argouml.org/profiles/uml14/default-uml14.xmi
file part: default-uml14.xmi.
The resource is searched this way:
eg: [file part extension]/[file part]
eg: xmi/default-uml14.xmi
You should assign this ResourceResolver on
Transformer but not on
TransformerFactory.
| Field Summary | |
|---|---|
protected java.lang.String |
base
|
protected java.lang.ClassLoader |
cl
le classe loader utilise pour recuperer les resources |
static java.util.regex.Pattern |
HREF_PATTERN
le pattern de detection d'une uri |
protected static java.util.SortedMap<java.lang.String,javax.xml.transform.Source> |
sourceCache
Shared Cache to not search in full classpath at each request. |
protected static java.util.Set<java.lang.String> |
unresolvedCache
Shared Cache of not local resources |
protected boolean |
verbose
le niveau de verbosite |
| Constructor Summary | |
|---|---|
ResourceResolver()
|
|
ResourceResolver(java.lang.String base)
|
|
| Method Summary | |
|---|---|
static void |
clearCache()
Pour vider le cache partage. |
protected javax.xml.transform.Source |
findHrefSource(java.lang.String path)
|
protected javax.xml.transform.Source |
findRelativeSource(java.lang.String path)
|
javax.xml.transform.Source |
resolve(java.lang.String href,
java.lang.String base)
Resolve href on local resource. |
void |
setCl(java.lang.ClassLoader cl)
|
void |
setVerbose(boolean verbose)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.util.SortedMap<java.lang.String,javax.xml.transform.Source> sourceCache
protected static final java.util.Set<java.lang.String> unresolvedCache
public static final java.util.regex.Pattern HREF_PATTERN
protected java.lang.String base
protected boolean verbose
protected java.lang.ClassLoader cl
| Constructor Detail |
|---|
public ResourceResolver()
public ResourceResolver(java.lang.String base)
| Method Detail |
|---|
public static void clearCache()
public javax.xml.transform.Source resolve(java.lang.String href,
java.lang.String base)
resolve in interface javax.xml.transform.URIResolverpublic void setVerbose(boolean verbose)
public void setCl(java.lang.ClassLoader cl)
protected javax.xml.transform.Source findHrefSource(java.lang.String path)
protected javax.xml.transform.Source findRelativeSource(java.lang.String path)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||