org.apache.jackrabbit.name
Class NameFormat

java.lang.Object
  extended by org.apache.jackrabbit.name.NameFormat

Deprecated. Use the NameResolver interface from the org.apache.jackrabbit.spi.commons.conversion package of the jackrabbit-spi-commons component.

public class NameFormat
extends Object

NameFormat provides methods for formatting and parsing names.


Constructor Summary
NameFormat()
          Deprecated.  
 
Method Summary
static void checkFormat(String jcrName)
          Deprecated. Checks if jcrName is a valid JCR-style name.
static String[] format(QName[] qNames, NamespaceResolver resolver)
          Deprecated. Same as format(QName, NamespaceResolver) except that this method takes an array of QNames and returns an array of corresponding string representations.
static String format(QName qName, NamespaceResolver resolver)
          Deprecated. Formats the given QName to produce a string representation, i.e.
static void format(QName qName, NamespaceResolver resolver, StringBuffer buffer)
          Deprecated. Same as format(QName, NamespaceResolver) except that this method appends the JCR-style name to the given buffer rather than returning it directly.
static QName[] parse(String[] jcrNames, NamespaceResolver resolver)
          Deprecated. Converts each JCR-style name in the passed array to its corresponding QName and returns the resulting QName array.
static QName parse(String jcrName, NamespaceResolver resolver)
          Deprecated. Converts the jcrName to its corresponding QName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameFormat

public NameFormat()
Deprecated. 
Method Detail

parse

public static QName parse(String jcrName,
                          NamespaceResolver resolver)
                   throws IllegalNameException,
                          UnknownPrefixException
Deprecated. 
Converts the jcrName to its corresponding QName. If the resolver passed is also an instance of NameCache then this method first attempts to find the corresponding QName in the cache. If it cannot be found then the jcrName is parsed and the corresponding QName constructed.

Parameters:
jcrName - the JCR-style name to be parsed
resolver - NamespaceResolver used for resolving prefixes into namespace URIs
Returns:
the resulting QName
Throws:
IllegalNameException - If jcrName is not a valid JCR-style name.
UnknownPrefixException

parse

public static QName[] parse(String[] jcrNames,
                            NamespaceResolver resolver)
                     throws IllegalNameException,
                            UnknownPrefixException
Deprecated. 
Converts each JCR-style name in the passed array to its corresponding QName and returns the resulting QName array. If the resolver passed is also an instance of NameCache then this method first attempts to find the corresponding QName in the cache. If it cannot be found then the jcrName is parsed and the corresponding QName constructed.

Parameters:
jcrNames - the array of JCR-style names to be parsed
resolver - NamespaceResolver used for resolving prefixes into namespace URIs
Returns:
the resulting QName array
Throws:
IllegalNameException - If any of the passed names is not a valid JCR-style name.
UnknownPrefixException

checkFormat

public static void checkFormat(String jcrName)
                        throws IllegalNameException
Deprecated. 
Checks if jcrName is a valid JCR-style name.

Parameters:
jcrName - the name to be checked
Throws:
IllegalNameException - If jcrName is not a valid JCR-style name.

format

public static String format(QName qName,
                            NamespaceResolver resolver)
                     throws NoPrefixDeclaredException
Deprecated. 
Formats the given QName to produce a string representation, i.e. JCR-style name. If the resolver passed is also an instance of NameCache then this method first attempts to find the corresponding JCR-style name in the cache. If it cannot be found then a new string representation is constructed.

Parameters:
qName - the QName to format
resolver - NamespaceResolver used for resolving namespace URIs into prefixes
Returns:
the string representation (JCR-style name) of the given QName
Throws:
NoPrefixDeclaredException - if a namespace can not be resolved
See Also:
format(QName, NamespaceResolver, StringBuffer)

format

public static String[] format(QName[] qNames,
                              NamespaceResolver resolver)
                       throws NoPrefixDeclaredException
Deprecated. 
Same as format(QName, NamespaceResolver) except that this method takes an array of QNames and returns an array of corresponding string representations.

Parameters:
qNames - the array QNames to format
resolver - NamespaceResolver used for resolving namespace URIs into prefixes
Returns:
the array of corresponding string representations
Throws:
NoPrefixDeclaredException - if a namespace can not be resolved
See Also:
format(QName, NamespaceResolver)

format

public static void format(QName qName,
                          NamespaceResolver resolver,
                          StringBuffer buffer)
                   throws NoPrefixDeclaredException
Deprecated. 
Same as format(QName, NamespaceResolver) except that this method appends the JCR-style name to the given buffer rather than returning it directly.

Parameters:
qName - the QName to format
resolver - NamespaceResolver used for resolving namespace URIs into prefixes
buffer - StringBuffer where the string representation should be appended to
Throws:
NoPrefixDeclaredException - if a namespace can not be resolved


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