org.apache.jackrabbit.spi.commons.conversion
Class ParsingPathResolver

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.conversion.ParsingPathResolver
All Implemented Interfaces:
PathResolver

public class ParsingPathResolver
extends Object
implements PathResolver

Path resolver that parsers and formats prefixed JCR paths. A NameResolver is used for resolving the path element names.


Constructor Summary
ParsingPathResolver(PathFactory pathFactory, NameResolver resolver)
          Creates a parsing path resolver.
 
Method Summary
 String getJCRPath(Path path)
          Returns the prefixed JCR path for the given qualified path.
 Path getQPath(String path)
          Parses the prefixed JCR path and returns the resolved qualified path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsingPathResolver

public ParsingPathResolver(PathFactory pathFactory,
                           NameResolver resolver)
Creates a parsing path resolver.

Parameters:
resolver - name resolver
Method Detail

getQPath

public Path getQPath(String path)
              throws MalformedPathException,
                     IllegalNameException,
                     NamespaceException
Parses the prefixed JCR path and returns the resolved qualified path.

Specified by:
getQPath in interface PathResolver
Parameters:
path - prefixed JCR path
Returns:
qualified path
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

getJCRPath

public String getJCRPath(Path path)
                  throws NamespaceException
Returns the prefixed JCR path for the given qualified path.

Specified by:
getJCRPath in interface PathResolver
Parameters:
path - qualified path
Returns:
prefixed JCR path
Throws:
NamespaceException - if a namespace URI can not be resolved


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.