public class ResourceResolver extends Object implements URIResolver
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:[file part extension]/[file part]
xmi/default-uml14.xmi
Transformer
but not on TransformerFactory
.Modifier and Type | Field and Description |
---|---|
protected String |
base |
protected ClassLoader |
cl
le classe loader utilise pour recuperer les resources
|
static Pattern |
HREF_PATTERN
le pattern de detection d'une uri
|
protected static SortedMap<String,Source> |
sourceCache
Shared Cache to not search in full classpath at each request.
|
protected static Set<String> |
unresolvedCache
Shared Cache of not local resources
|
protected boolean |
verbose
le niveau de verbosite
|
Constructor and Description |
---|
ResourceResolver() |
ResourceResolver(String base) |
Modifier and Type | Method and Description |
---|---|
static void |
clearCache()
Pour vider le cache partage.
|
protected Source |
findHrefSource(String path) |
protected Source |
findRelativeSource(String path) |
Source |
resolve(String href,
String base)
Resolve href on local resource.
|
void |
setCl(ClassLoader cl) |
void |
setVerbose(boolean verbose) |
protected static final SortedMap<String,Source> sourceCache
protected static final Set<String> unresolvedCache
public static final Pattern HREF_PATTERN
protected String base
protected boolean verbose
protected ClassLoader cl
public ResourceResolver()
public ResourceResolver(String base)
public static void clearCache()
public Source resolve(String href, String base)
resolve
in interface URIResolver
public void setVerbose(boolean verbose)
public void setCl(ClassLoader cl)
Copyright © 2004–2020 CodeLutin. All rights reserved.