netscape.ldap.util

Class LDAPWriter

Implemented Interfaces:
Serializable
Known Direct Subclasses:
DSMLWriter, LDIFWriter

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

Abstract class for outputting LDAP entries to a stream.
Version:
1.0

Field Summary

protected PrintWriter
m_pw

Constructor Summary

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

Method Summary

protected 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(String dn)
Print epilogue to entry
protected abstract void
printEntryStart(String dn)
Print prologue to entry
void
printSchema(LDAPEntry entry)
Default schema writer - assumes an ordinary entry

Field Details

m_pw

protected PrintWriter m_pw

Constructor Details

LDAPWriter

public LDAPWriter(PrintWriter pw)
Constructs an LDAPWriter object to output entries to a stream.
Parameters:
pw - output stream

Method Details

getPrintableValue

protected String getPrintableValue(byte[] b)

printAttribute

protected abstract void printAttribute(LDAPAttribute attr)
Print an attribute of an entry
Parameters:
attr - the attribute to format to the output stream

printEntry

public void printEntry(LDAPEntry entry)
            throws 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

printEntryEnd

protected abstract void printEntryEnd(String dn)
Print epilogue to entry
Parameters:
dn - the DN of the entry

printEntryStart

protected abstract void printEntryStart(String dn)
Print prologue to entry
Parameters:
dn - the DN of the entry

printSchema

public void printSchema(LDAPEntry entry)
            throws IOException
Default schema writer - assumes an ordinary entry
Parameters:
entry - an LDAPEntry containing schema to be formatted to the output stream