com.hunnysoft.jmime
Class TransferEncodingType

java.lang.Object
  extended by com.hunnysoft.jmime.Node
      extended by com.hunnysoft.jmime.FieldBody
          extended by com.hunnysoft.jmime.TransferEncodingType
All Implemented Interfaces:
java.lang.Cloneable

public class TransferEncodingType
extends FieldBody

Class that represents the field body of a "Content-Transfer-Encoding" header field.

TransferEncodingType represents a field body for the Content-Transfer-Encoding header field as described in RFC 2045. This header field specifies how the content is encoded for transport through the mail system. Standard values include 7bit, 8bit, binary, quoted-printable, and base64.


Field Summary
static int _7BIT
          Enumerated value for 7bit transfer encoding type
static int _8BIT
          Enumerated value for 8bit transfer encoding type
static int BASE64
          Enumerated value for base64 transfer encoding type
static int BINARY
          Enumerated value for binary transfer encoding type
static int NULL
          Enumerated value for unset transfer encoding type
static int QUOTED_PRINTABLE
          Enumerated value for quoted-printable transfer encoding type
static int UNKNOWN
          Enumerated value for unknown transfer encoding type
 
Fields inherited from class com.hunnysoft.jmime.FieldBody
mText
 
Fields inherited from class com.hunnysoft.jmime.Node
mIsModified, mParent, mString
 
Constructor Summary
TransferEncodingType()
          Default constructor.
TransferEncodingType(ByteString bstr)
          Constructor that takes an initial byte string argument.
TransferEncodingType(TransferEncodingType other)
          Copy constructor.
 
Method Summary
 int asEnum()
          Gets the transfer encoding type as an enumerated value.
 void assemble()
          Assembles the string representation.
 java.lang.Object clone()
          Creates a copy of this object.
 void fromEnum(int type)
          Sets the transfer encoding type from an enumerated value.
 void parse()
          Parses the string representation.
 void setType(java.lang.String type)
          Sets the transfer encoding type value.
 java.lang.String type()
          Gets the transfer encoding type value.
 
Methods inherited from class com.hunnysoft.jmime.FieldBody
fold, isFoldingEnabled, maybeFold, setFoldingEnabled, setText, text, unfold
 
Methods inherited from class com.hunnysoft.jmime.Node
_setString, isModified, parent, setModified, setParent, setString, string, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final int NULL
Enumerated value for unset transfer encoding type

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Enumerated value for unknown transfer encoding type

See Also:
Constant Field Values

_7BIT

public static final int _7BIT
Enumerated value for 7bit transfer encoding type

See Also:
Constant Field Values

_8BIT

public static final int _8BIT
Enumerated value for 8bit transfer encoding type

See Also:
Constant Field Values

QUOTED_PRINTABLE

public static final int QUOTED_PRINTABLE
Enumerated value for quoted-printable transfer encoding type

See Also:
Constant Field Values

BASE64

public static final int BASE64
Enumerated value for base64 transfer encoding type

See Also:
Constant Field Values

BINARY

public static final int BINARY
Enumerated value for binary transfer encoding type

See Also:
Constant Field Values
Constructor Detail

TransferEncodingType

public TransferEncodingType()
Default constructor.

This constructor sets the TransferEncodingType object's string representation to the empty string and sets its parent node to null.


TransferEncodingType

public TransferEncodingType(TransferEncodingType other)
Copy constructor.

This constructor performs a deep copy of its argument. The parent node of the new TransferEncodingType object is set to null.

Parameters:
other - TransferEncodingType instance to copy

TransferEncodingType

public TransferEncodingType(ByteString bstr)
Constructor that takes an initial byte string argument.

This constructor sets the TransferEncodingType object's string representation to bstr and sets its parent node to null.

Normally, you call the Parse() method immediately after this constructor to create the broken-down representation.

Parameters:
bstr - initial value for the string representation
Method Detail

clone

public java.lang.Object clone()
Creates a copy of this object. This method, inherited from Object, creates a new TransferEncodingType object that has the same value as this TransferEncodingType object. The parent node of the new TransferEncodingType object is set to null.

Overrides:
clone in class FieldBody
Returns:
a copy of this object

type

public java.lang.String type()
Gets the transfer encoding type value.

Returns:
transfer encoding type value

setType

public void setType(java.lang.String type)
Sets the transfer encoding type value.

Parameters:
type - transfer encoding type value

asEnum

public int asEnum()
Gets the transfer encoding type as an enumerated value.

Returns:
transfer encoding type as an enumerated value

fromEnum

public void fromEnum(int type)
Sets the transfer encoding type from an enumerated value.

Parameters:
type - transfer encoding type as an enumerated value

parse

public void parse()
Parses the string representation.

This method, inherited from Node, executes the parse operation for TransferEncodingType objects. The parse operation creates or updates the broken-down representation from the string representation. For TransferEncodingType objects, the parse operation parses the string representation to extract the transfer encoding type value.

You should call this method after you set or modify the string representation, and before you access the transfer encoding type value.

This method clears the is-modified flag.

Overrides:
parse in class FieldBody
See Also:
Node.assemble()

assemble

public void assemble()
Assembles the string representation.

This method, inherited from Node, executes the assemble operation for TransferEncodingType objects. The assemble operation creates or updates the string representation from the broken-down representation. For TransferEncodingType objects, the assemble operation builds the string representation from the transfer encoding type value.

You should call this method after you set or modify the transfer encoding type value, and before you retrieve the string representation.

This method clears the is-modified flag.

Overrides:
assemble in class FieldBody
See Also:
Node.parse()