com.sun.mail.iap
Class Argument

java.lang.Object
  extended by com.sun.mail.iap.Argument

public class Argument
extends Object

Author:
John Mani

Field Summary
protected  Vector items
           
 
Constructor Summary
Argument()
          Constructor
 
Method Summary
 void append(Argument arg)
          append the given Argument to this Argument.
 void write(Protocol protocol)
           
 void writeArgument(Argument c)
          Write out as parenthesised list.
 void writeAtom(String s)
          Write out given string as an Atom.
 void writeBytes(byte[] b)
          Write out given byte[] as a Literal.
 void writeBytes(ByteArrayOutputStream b)
          Write out given ByteArrayOutputStream as a Literal.
 void writeBytes(Literal b)
          Write out given data as a literal.
 void writeNumber(int i)
          Write out number.
 void writeNumber(long i)
          Write out number.
 void writeString(String s)
          Write out given string as an ASTRING, depending on the type of the characters inside the string.
 void writeString(String s, String charset)
          Convert the given string into bytes in the specified charset, and write the bytes out as an ASTRING
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

protected Vector items
Constructor Detail

Argument

public Argument()
Constructor

Method Detail

append

public void append(Argument arg)
append the given Argument to this Argument. All items from the source argument are copied into this destination argument.


writeString

public void writeString(String s)
Write out given string as an ASTRING, depending on the type of the characters inside the string. The string should contain only ASCII characters.

XXX: Hmm .. this should really be called writeASCII()

Parameters:
s - String to write out

writeString

public void writeString(String s,
                        String charset)
                 throws UnsupportedEncodingException
Convert the given string into bytes in the specified charset, and write the bytes out as an ASTRING

Throws:
UnsupportedEncodingException

writeBytes

public void writeBytes(byte[] b)
Write out given byte[] as a Literal.

Parameters:
b - byte[] to write out

writeBytes

public void writeBytes(ByteArrayOutputStream b)
Write out given ByteArrayOutputStream as a Literal.

Parameters:
b - ByteArrayOutputStream to be written out.

writeBytes

public void writeBytes(Literal b)
Write out given data as a literal.

Parameters:
b - Literal representing data to be written out.

writeAtom

public void writeAtom(String s)
Write out given string as an Atom. Note that an Atom can contain only certain US-ASCII characters. No validation is done on the characters in the string.

Parameters:
s - String

writeNumber

public void writeNumber(int i)
Write out number.

Parameters:
i - number

writeNumber

public void writeNumber(long i)
Write out number.

Parameters:
i - number

writeArgument

public void writeArgument(Argument c)
Write out as parenthesised list.

Parameters:
s - statement

write

public void write(Protocol protocol)
           throws IOException,
                  ProtocolException
Throws:
IOException
ProtocolException


Copyright © 2011 Sun Microsystems, Inc.. All Rights Reserved.