Class ResourceResolver
java.lang.Object
org.nuiton.util.ResourceResolver
- All Implemented Interfaces:
URIResolver
- Direct Known Subclasses:
FasterCachedResourceResolver
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.
- eg:
[file part extension]/[file part] - eg:
xmi/default-uml14.xmi
Transformer but not on TransformerFactory.- Author:
- chorlet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected ClassLoaderle classe loader utilise pour recuperer les resourcesstatic final Patternle pattern de detection d'une uriShared Cache to not search in full classpath at each request.Shared Cache of not local resourcesprotected booleanle niveau de verbosite -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidPour vider le cache partage.protected SourcefindHrefSource(String path) protected SourcefindRelativeSource(String path) Resolve href on local resource.voidsetCl(ClassLoader cl) voidsetVerbose(boolean verbose)
-
Field Details
-
sourceCache
-
unresolvedCache
-
HREF_PATTERN
le pattern de detection d'une uri -
base
-
verbose
protected boolean verbosele niveau de verbosite -
cl
le classe loader utilise pour recuperer les resources
-
-
Constructor Details
-
ResourceResolver
public ResourceResolver() -
ResourceResolver
-
-
Method Details
-
clearCache
public static void clearCache()Pour vider le cache partage. -
resolve
Resolve href on local resource.- Specified by:
resolvein interfaceURIResolver- Returns:
- null if local resource not found
-
setVerbose
public void setVerbose(boolean verbose) -
setCl
-
findHrefSource
-
findRelativeSource
-