netscape.ldap.util
Class LDAPWriter

java.lang.Object
  extended bynetscape.ldap.util.LDAPWriter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DSMLWriter, LDIFWriter

public abstract class LDAPWriter
extends java.lang.Object
implements java.io.Serializable

Abstract class for outputting LDAP entries to a stream.

See Also:
Serialized Form

Field Summary
protected  java.io.PrintWriter m_pw
           
 
Constructor Summary
LDAPWriter(java.io.PrintWriter pw)
          Constructs an LDAPWriter object to output entries to a stream.
 
Method Summary
protected  java.lang.String getPrintableValue(byte[] b)
           
protected abstract  void printAttribute(LDAPAttribute attr)
          Print an attribute of an entry
 void printEntry(LDAPEntry entry)
          The main method of LDAPWriter.
protected abstract  void printEntryEnd(java.lang.String dn)
          Print epilogue to entry
protected abstract  void printEntryStart(java.lang.String dn)
          Print prologue to entry
protected  void printFooter()
          Print footer at bottom of output
protected  void printHeader()
          Print header at top of output These two new functions are not abstract to avoid breaking other classes
 void printSchema(LDAPEntry entry)
          Default schema writer - assumes an ordinary entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_pw

protected java.io.PrintWriter m_pw
Constructor Detail

LDAPWriter

public LDAPWriter(java.io.PrintWriter pw)
Constructs an LDAPWriter object to output entries to a stream.

Parameters:
pw - output stream
Method Detail

printEntry

public void printEntry(LDAPEntry entry)
                throws java.io.IOException
The main method of LDAPWriter. It calls printEntryIntro, printAttribute, and printEntryEnd of derived classes.

Parameters:
entry - an LDAPEntry to be formatted to the output stream
Throws:
java.io.IOException

printSchema

public void printSchema(LDAPEntry entry)
                 throws java.io.IOException
Default schema writer - assumes an ordinary entry

Parameters:
entry - an LDAPEntry containing schema to be formatted to the output stream
Throws:
java.io.IOException

printAttribute

protected abstract void printAttribute(LDAPAttribute attr)
Print an attribute of an entry

Parameters:
attr - the attribute to format to the output stream

printEntryStart

protected abstract void printEntryStart(java.lang.String dn)
Print prologue to entry

Parameters:
dn - the DN of the entry

printEntryEnd

protected abstract void printEntryEnd(java.lang.String dn)
Print epilogue to entry

Parameters:
dn - the DN of the entry

printHeader

protected void printHeader()
Print header at top of output These two new functions are not abstract to avoid breaking other classes


printFooter

protected void printFooter()
Print footer at bottom of output


getPrintableValue

protected java.lang.String getPrintableValue(byte[] b)