org.apache.directory.shared.ldap.ldif
Class LdifParserImpl

java.lang.Object
  extended byorg.apache.directory.shared.ldap.ldif.LdifParserImpl
All Implemented Interfaces:
LdifParser

public class LdifParserImpl
extends java.lang.Object
implements LdifParser

An LDAP Data Interchange Format (LDIF) parser. All LDIF attributes including control attributes within the LDIF that are not part of the entry proper are added to the Attributes or MultiMap instance supplied for population. These attributes where applicable need to be removed from the populated MultiMap or Attributes instance. Until they are the populated container cannot be deemed representative of an entry.

Version:
$Rev: 379008 $
Author:
Apache Directory Project
See Also:
RFC 2849

Constructor Summary
LdifParserImpl()
           
 
Method Summary
 byte[] base64decode(java.lang.String attrValue)
          Decodes an encoded string in base64 into a byte array.
 void parse(javax.naming.directory.Attributes attributes, java.lang.String ldif)
          Parses an String representing an entry in LDAP Data Interchange Format (LDIF) storing its attributes in the supplied Attributes instance.
 LdifEntry parse(java.lang.String an_ldif)
          Parses an String representing an entry in LDAP Data Interchange Format (LDIF) storing its attributes in the supplied ldap entry instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdifParserImpl

public LdifParserImpl()
Method Detail

base64decode

public byte[] base64decode(java.lang.String attrValue)
Decodes an encoded string in base64 into a byte array.

Parameters:
attrValue - the value of a encoded binary attribute.
Returns:
the decoded binary data as a byte array.

parse

public void parse(javax.naming.directory.Attributes attributes,
                  java.lang.String ldif)
           throws javax.naming.NamingException
Parses an String representing an entry in LDAP Data Interchange Format (LDIF) storing its attributes in the supplied Attributes instance.

Specified by:
parse in interface LdifParser
Parameters:
attributes - the attributes from the LDIF including the DN of the entry represented by the LDIF.
ldif - the entry in LDAP Data Interchange Format
Throws:
javax.naming.NamingException - if there any failures while parsing the LDIF and populating the attirubutes

parse

public LdifEntry parse(java.lang.String an_ldif)
                throws javax.naming.NamingException
Parses an String representing an entry in LDAP Data Interchange Format (LDIF) storing its attributes in the supplied ldap entry instance.

Specified by:
parse in interface LdifParser
Parameters:
an_ldif - the entry in LDAP Data Interchange Format
Returns:
the LdifEntry parsed from the LDIF string
Throws:
javax.naming.NamingException - if there any failures while parsing the LDIF and populating the attirubutes


Copyright © 2003-2006 . All Rights Reserved.