org.apache.directory.shared.ldap.name
Enum FastDnParser

java.lang.Object
  extended by java.lang.Enum<FastDnParser>
      extended by org.apache.directory.shared.ldap.name.FastDnParser
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FastDnParser>

public enum FastDnParser
extends java.lang.Enum<FastDnParser>

A fast LDAP DN parser that handles only simple DNs. If the DN contains any special character an TooComplexException is thrown.

Version:
$Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sa, 07 Jun 2008) $
Author:
Apache Directory Project

Enum Constant Summary
INSTANCE
           
 
Method Summary
static FastDnParser getNameParser()
          Gets the name parser singleton instance.
 DN parse(java.lang.String name)
          Parses a DN from a String
 void parseDn(java.lang.String name, DN dn)
          Parses the given name string and fills the given DN object.
 void parseRdn(java.lang.String name, RDN rdn)
          Parses the given name string and fills the given Rdn object.
static FastDnParser valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FastDnParser[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSTANCE

public static final FastDnParser INSTANCE
Method Detail

values

public static FastDnParser[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FastDnParser c : FastDnParser.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FastDnParser valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getNameParser

public static FastDnParser getNameParser()
Gets the name parser singleton instance.

Returns:
the name parser

parse

public DN parse(java.lang.String name)
         throws LdapException
Parses a DN from a String

Parameters:
name - The DN to parse
Returns:
A valid DN
Throws:
LdapException - If the DN was invalid

parseDn

public void parseDn(java.lang.String name,
                    DN dn)
             throws LdapInvalidDnException
Parses the given name string and fills the given DN object.

Parameters:
name - the name to parse
dn - the DN to fill
Throws:
LdapInvalidDnException - the invalid name exception

parseRdn

public void parseRdn(java.lang.String name,
                     RDN rdn)
              throws LdapInvalidDnException
Parses the given name string and fills the given Rdn object.

Parameters:
name - the name to parse
rdn - the RDN to fill
Throws:
LdapInvalidDnException - the invalid name exception


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.