Top Fields Constructors Methods
com.sun.mail.iap

public Class Argument

Additional top-level classes in compilation unit: Atom, AString, NString.

extends Object
Class Inheritance
Imports
java.util.List, .ArrayList, java.io.*, java.nio.charset.Charset, com.sun.mail.util.ASCIIUtility

Authors
John Mani, Bill Shannon

Field Summary

Modifier and TypeField and Description
protected List<Object>

Constructor Summary

AccessConstructor and Description
public
Argument()

Constructor

Method Summary

Modifier and TypeMethod and Description
public Argument

Returns:

this
append
(Argument
the Argument to append
arg
)

Append the given Argument to this Argument.

private void
astring(byte[] bytes, Protocol protocol)

Write out given String as either an Atom, QuotedString or Literal

private void
literal(byte[] b, Protocol protocol)

Write out given byte[] as a literal

private void
literal(ByteArrayOutputStream b, Protocol protocol)

Write out given ByteArrayOutputStream as a literal.

private void
literal(Literal b, Protocol protocol)

Write out given Literal as a literal.

private void
nastring(byte[] bytes, Protocol protocol, boolean doQuote)

private void
nstring(byte[] bytes, Protocol protocol)

Write out given String as either NIL, QuotedString, or Literal.

private OutputStream
startLiteral(Protocol protocol, int size)

public void
write(Protocol protocol)

public Argument

Returns:

this
writeArgument
(Argument
the Argument
c
)

Write out as parenthesised list.

public Argument

Returns:

this
writeAtom
(String
String
s
)

Write out given string as an Atom.

public Argument

Returns:

this
writeBytes
(byte[]
byte[] to write out
b
)

Write out given byte[] as a Literal.

public Argument

Returns:

this
writeBytes
(ByteArrayOutputStream
ByteArrayOutputStream to be written out.
b
)

Write out given ByteArrayOutputStream as a Literal.

public Argument

Returns:

this
writeBytes
(Literal
Literal representing data to be written out.
b
)

Write out given data as a literal.

public Argument

Returns:

this
writeNString
(String
String to write out
s
)

Write out given string as an NSTRING, depending on the type of the characters inside the string.

public Argument

Returns:

this
writeNString
(String
String to write out
s
,
String
the charset
charset
)

Convert the given string into bytes in the specified charset, and write the bytes out as an NSTRING

public Argument

Returns:

this
writeNString
(String
String to write out
s
,
Charset
the charset
charset
)

Convert the given string into bytes in the specified charset, and write the bytes out as an NSTRING

public Argument

Returns:

this
writeNumber
(int
number
i
)

Write out number.

public Argument

Returns:

this
writeNumber
(long
number
i
)

Write out number.

public Argument

Returns:

this
writeString
(String
String to write out
s
)

Write out given string as an ASTRING, depending on the type of the characters inside the string.

public Argument

Returns:

this
writeString
(String
String to write out
s
,
String
the charset
charset
)

Convert the given string into bytes in the specified charset, and write the bytes out as an ASTRING

public Argument

Returns:

this
writeString
(String
String to write out
s
,
Charset
the charset
charset
)

Convert the given string into bytes in the specified charset, and write the bytes out as an ASTRING

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

itemsback to summary
protected List<Object> items

Constructor Detail

Argumentback to summary
public Argument()

Constructor

Method Detail

appendback to summary
public Argument append(Argument arg)

Append the given Argument to this Argument. All items from the source argument are copied into this destination argument.

Parameters
arg:Argument

the Argument to append

Returns:Argument

this

astringback to summary
private void astring(byte[] bytes, Protocol protocol) throws IOException, ProtocolException

Write out given String as either an Atom, QuotedString or Literal

literalback to summary
private void literal(byte[] b, Protocol protocol) throws IOException, ProtocolException

Write out given byte[] as a literal

literalback to summary
private void literal(ByteArrayOutputStream b, Protocol protocol) throws IOException, ProtocolException

Write out given ByteArrayOutputStream as a literal.

literalback to summary
private void literal(Literal b, Protocol protocol) throws IOException, ProtocolException

Write out given Literal as a literal.

nastringback to summary
private void nastring(byte[] bytes, Protocol protocol, boolean doQuote) throws IOException, ProtocolException
nstringback to summary
private void nstring(byte[] bytes, Protocol protocol) throws IOException, ProtocolException

Write out given String as either NIL, QuotedString, or Literal.

startLiteralback to summary
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException
writeback to summary
public void write(Protocol protocol) throws IOException, ProtocolException
writeArgumentback to summary
public Argument writeArgument(Argument c)

Write out as parenthesised list.

Parameters
c:Argument

the Argument

Returns:Argument

this

writeAtomback to summary
public Argument 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

String

Returns:Argument

this

writeBytesback to summary
public Argument writeBytes(byte[] b)

Write out given byte[] as a Literal.

Parameters
b:byte[]

byte[] to write out

Returns:Argument

this

writeBytesback to summary
public Argument writeBytes(ByteArrayOutputStream b)

Write out given ByteArrayOutputStream as a Literal.

Parameters
b:ByteArrayOutputStream

ByteArrayOutputStream to be written out.

Returns:Argument

this

writeBytesback to summary
public Argument writeBytes(Literal b)

Write out given data as a literal.

Parameters
b:Literal

Literal representing data to be written out.

Returns:Argument

this

writeNStringback to summary
public Argument writeNString(String s)

Write out given string as an NSTRING, depending on the type of the characters inside the string. The string should contain only ASCII characters.

Parameters
s:String

String to write out

Returns:Argument

this

Since
JavaMail 1.5.1
writeNStringback to summary
public Argument writeNString(String s, String charset) throws UnsupportedEncodingException

Convert the given string into bytes in the specified charset, and write the bytes out as an NSTRING

Parameters
s:String

String to write out

charset:String

the charset

Returns:Argument

this

Exceptions
UnsupportedEncodingException:
for bad charset
Since
JavaMail 1.5.1
writeNStringback to summary
public Argument writeNString(String s, Charset charset)

Convert the given string into bytes in the specified charset, and write the bytes out as an NSTRING

Parameters
s:String

String to write out

charset:Charset

the charset

Returns:Argument

this

Since
JavaMail 1.6.0
writeNumberback to summary
public Argument writeNumber(int i)

Write out number.

Parameters
i:int

number

Returns:Argument

this

writeNumberback to summary
public Argument writeNumber(long i)

Write out number.

Parameters
i:long

number

Returns:Argument

this

writeStringback to summary
public Argument 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

String to write out

Returns:Argument

this

writeStringback to summary
public Argument 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

Parameters
s:String

String to write out

charset:String

the charset

Returns:Argument

this

Exceptions
UnsupportedEncodingException:
for bad charset
writeStringback to summary
public Argument writeString(String s, Charset charset)

Convert the given string into bytes in the specified charset, and write the bytes out as an ASTRING

Parameters
s:String

String to write out

charset:Charset

the charset

Returns:Argument

this

Since
JavaMail 1.6.0