public class Attr
extends java.lang.Object
Attr
class encapsulates a TNEF attribute. A TNEF stream
consists of a flat list of attributes, which belong either to the message
level or attachment level. An attAttachRenddata attribute marks the beginning
of an attachment, and all subsequent attributes (until the next attachment
begins) belong to it.
Different attributes have a different meaning for the underlying raw data,
thus the getValue() method returns different types of objects. The object
returned is determined by the attribute type, except for several special
cases.Modifier and Type | Field and Description |
---|---|
static int |
atpByte
Attribute type constant.
|
static int |
atpDate
Attribute type constant.
|
static int |
atpDword
Attribute type constant.
|
static int |
atpLong
Attribute type constant.
|
static int |
atpMax
Attribute type constant.
|
static int |
atpShort
Attribute type constant.
|
static int |
atpString
Attribute type constant.
|
static int |
atpText
Attribute type constant.
|
static int |
atpTriples
Attribute type constant.
|
static int |
atpWord
Attribute type constant.
|
static int |
attAidOwner
Attribute ID constant.
|
static int |
attAttachCreateDate
Attribute ID constant.
|
static int |
attAttachData
Attribute ID constant.
|
static int |
attAttachment
Attribute ID constant.
|
static int |
attAttachMetaFile
Attribute ID constant.
|
static int |
attAttachModifyDate
Attribute ID constant.
|
static int |
attAttachRenddata
Attribute ID constant.
|
static int |
attAttachTitle
Attribute ID constant.
|
static int |
attAttachTransportFilename
Attribute ID constant.
|
static int |
attBody
Attribute ID constant.
|
static int |
attConversationID
Attribute ID constant.
|
static int |
attDateEnd
Attribute ID constant.
|
static int |
attDateModified
Attribute ID constant.
|
static int |
attDateRecd
Attribute ID constant.
|
static int |
attDateSent
Attribute ID constant.
|
static int |
attDateStart
Attribute ID constant.
|
static int |
attDelegate
Attribute ID constant.
|
static int |
attFrom
Attribute ID constant.
|
static int |
attMAPIProps
Attribute ID constant.
|
static int |
attMessageClass
Attribute ID constant.
|
static int |
attMessageID
Attribute ID constant.
|
static int |
attMessageStatus
Attribute ID constant.
|
static int |
attNull
Attribute ID constant.
|
static int |
attOemCodepage
Attribute ID constant.
|
static int |
attOriginalMessageClass
Attribute ID constant.
|
static int |
attOwner
Attribute ID constant.
|
static int |
attParentID
Attribute ID constant.
|
static int |
attPriority
Attribute ID constant.
|
static int |
attRecipTable
Attribute ID constant.
|
static int |
attRequestRes
Attribute ID constant.
|
static int |
attSentFor
Attribute ID constant.
|
static int |
attSubject
Attribute ID constant.
|
static int |
attTnefVersion
Attribute ID constant.
|
static byte |
LVL_ATTACHMENT
Attribute level constant.
|
static byte |
LVL_MESSAGE
Attribute level constant.
|
Constructor and Description |
---|
Attr(byte level,
int type,
int ID,
java.lang.Object data)
Constructs an Attr containing the specified values.
|
Attr(byte level,
int type,
int ID,
RawInputStream rawData)
Constructs an Attr containing the specified values.
|
Modifier and Type | Method and Description |
---|---|
static Attr |
findAttr(java.util.List<Attr> attributes,
int ID)
Finds an attribute with the specified ID within given attribute list.
|
int |
getID()
Gets the Attr ID.
|
int |
getLength()
Gets the Attr data length (in bytes).
|
byte |
getLevel()
Gets the Attr level.
|
RawInputStream |
getRawData()
Gets the Attr raw data.
|
int |
getType()
Gets the Attr type.
|
java.lang.Object |
getValue()
Returns the value of the Attr's data.
|
protected void |
read(RawInputStream in)
Reads this attribute's data from the given RawInputStream.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
public static final int atpTriples
public static final int atpString
public static final int atpText
public static final int atpDate
public static final int atpShort
public static final int atpLong
public static final int atpByte
public static final int atpWord
public static final int atpDword
public static final int atpMax
public static final byte LVL_MESSAGE
public static final byte LVL_ATTACHMENT
public static final int attNull
public static final int attFrom
public static final int attSubject
public static final int attDateSent
public static final int attDateRecd
public static final int attMessageStatus
public static final int attMessageClass
public static final int attMessageID
public static final int attParentID
public static final int attConversationID
public static final int attBody
public static final int attPriority
public static final int attAttachData
public static final int attAttachTitle
public static final int attAttachMetaFile
public static final int attAttachCreateDate
public static final int attAttachModifyDate
public static final int attDateModified
public static final int attAttachTransportFilename
public static final int attAttachRenddata
public static final int attMAPIProps
public static final int attRecipTable
public static final int attAttachment
public static final int attTnefVersion
public static final int attOemCodepage
public static final int attOriginalMessageClass
public static final int attOwner
public static final int attSentFor
public static final int attDelegate
public static final int attDateStart
public static final int attDateEnd
public static final int attAidOwner
public static final int attRequestRes
public Attr(byte level, int type, int ID, java.lang.Object data)
level
- the attribute level (from LVL_* constants)type
- the attribute type (from atp* constants)ID
- the attribute ID (from att* constants)data
- the attribute datapublic Attr(byte level, int type, int ID, RawInputStream rawData)
level
- the attribute level (from LVL_* constants)type
- the attribute type (from atp* constants)ID
- the attribute ID (from att* constants)rawData
- the attribute's raw datapublic byte getLevel()
public int getType()
public int getID()
public int getLength()
public RawInputStream getRawData()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object getValue() throws java.io.IOException
java.io.IOException
- if an I/O error occursprotected void read(RawInputStream in) throws java.io.IOException
in
- the RawInputStream containing attribute datajava.io.IOException
- if an I/O error occurspublic static Attr findAttr(java.util.List<Attr> attributes, int ID)
attributes
- the attribute list to searchID
- the ID of the attribute to search forCopyright © 2021. All Rights Reserved.