Class CachingPathResolver
java.lang.Object
org.apache.jackrabbit.spi.commons.conversion.CachingPathResolver
- All Implemented Interfaces:
PathResolver
Path resolver decorator that uses a generational cache to speed up
parsing and formatting of JCR paths. Uncached paths are resolved using
the underlying decorated path resolver.
-
Constructor Summary
ConstructorsConstructorDescriptionCachingPathResolver(PathResolver resolver) Creates a caching decorator for the given path resolver.CachingPathResolver(PathResolver resolver, org.apache.jackrabbit.spi.commons.conversion.GenerationalCache cache) Creates a caching decorator for the given path resolver. -
Method Summary
Modifier and TypeMethodDescriptiongetJCRPath(Path path) Returns the JCR path String for the givenPath.Returns thePathobject for the given JCR path String.Returns the path object for the given JCR path string.
-
Constructor Details
-
CachingPathResolver
public CachingPathResolver(PathResolver resolver, org.apache.jackrabbit.spi.commons.conversion.GenerationalCache cache) Creates a caching decorator for the given path resolver. The given generational cache is used for caching.- Parameters:
resolver- decorated path resolvercache- generational cache
-
CachingPathResolver
Creates a caching decorator for the given path resolver.- Parameters:
resolver- name resolver
-
-
Method Details
-
getQPath
public Path getQPath(String path) throws MalformedPathException, IllegalNameException, NamespaceException Returns thePathobject for the given JCR path String. The path is first looked up form the generational cache and the call gets delegated to the decorated path resolver only if the cache misses.- Specified by:
getQPathin interfacePathResolver- Parameters:
path- A JCR path String.- Returns:
- A
Pathobject. - Throws:
MalformedPathException- if the JCR path format is invalidIllegalNameException- if any of the JCR names contained in the path are invalid.NamespaceException- if a namespace prefix can not be resolved.- See Also:
-
getQPath
public Path getQPath(String path, boolean normalizeIdentifier) throws MalformedPathException, IllegalNameException, NamespaceException Description copied from interface:PathResolverReturns the path object for the given JCR path string.- Specified by:
getQPathin interfacePathResolver- Parameters:
path- prefixed JCR pathnormalizeIdentifier-- Returns:
- a
Pathobject. - Throws:
MalformedPathException- if the JCR path format is invalid.IllegalNameException- if any of the JCR names contained in the path are invalid.NamespaceException- if a namespace prefix can not be resolved.- See Also:
-
getJCRPath
Returns the JCR path String for the givenPath. The path is first looked up form the generational cache and the call gets delegated to the decorated path resolver only if the cache misses.- Specified by:
getJCRPathin interfacePathResolver- Parameters:
path- APathobject.- Returns:
- A JCR path String in the standard form.
- Throws:
NamespaceException- if a namespace URI can not be resolved.- See Also:
-