Section of a PropertySet.
The property's ID gives the property a meaning
in the context of its Section. Each Section spans
its own name space of property IDs.
The property's type determines how its
value is interpreted. For example, if the type is
Variant#VT_LPSTR (byte string), the value consists of a
DWord telling how many bytes the string contains. The bytes follow
immediately, including any null bytes that terminate the
string. The type Variant#VT_I4 denotes a four-byte integer
value, Variant#VT_FILETIME some date and time (of a file).
Please note that not all Variant types yet. This might change
over time but largely depends on your feedback so that the POI team knows
which variant types are really needed. So please feel free to submit error
reports or patches for the types you need.
Section, Variant, [MS-OLEPS]: Object Linking and Embedding (OLE) Property Set Data Structures
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT_CODEPAGE
Default codepage for |
| private long | id
The property's ID. |
| private static final Logger | |
| private long | type
The property's type. |
| private Object | value
The property's value. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | Property(final long
The property's ID. id, final byte[] The bytes the property set stream consists of. src, final long The property's type/value pair's offset in the
section. offset, final int The property's type/value pair's length in bytes. length, final int The section's and thus the property's
codepage. It is needed only when reading string values. codepage)Creates a Property instance by reading its bytes from the property set stream. |
| public | Property(final long
The property's ID. id, LittleEndianByteArrayInputStream The bytes the property set stream consists of. leis, final int The property's type/value pair's length in bytes. length, final int The section's and thus the property's
codepage. It is needed only when reading string values. codepage)Creates a Property instance by reading its bytes from the property set stream. |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides java. Compares two properties. |
| public long | |
| protected int | Returns: the property's size in bytesThe integer property to check property)Returns the property's size in bytes. |
| public long | |
| public Object | |
| private String | |
| public int | |
| public void | |
| public void | |
| public void | |
| public String | |
| public String | |
| private boolean | |
| private static int | Returns: the truncated size with a maximum of 4 bytes shorter (3 bytes + trailing 0 of strings)the bytes buf)Byte arrays can be 0-padded up to 3 bytes to form a full quad array. |
| public int | Returns: the number of bytes written to the streamThe output stream to write to. out, final int The codepage to use for writing non-wide strings codepage)Writes the property to an output stream. |
| DEFAULT_CODEPAGE | back to summary |
|---|---|
| public static final int DEFAULT_CODEPAGE Default codepage for | |
| id | back to summary |
|---|---|
| private long id The property's ID. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| type | back to summary |
|---|---|
| private long type The property's type. | |
| value | back to summary |
|---|---|
| private Object value The property's value. | |
| Property | back to summary |
|---|---|
| public Property() Creates an empty property. It must be filled using the set method to be usable. | |
| Property | back to summary |
|---|---|
| public Property(Property p) Creates a
| |
| Property | back to summary |
|---|---|
| public Property(final long id, final long type, final Object value) Creates a property. | |
| Property | back to summary |
|---|---|
| public Property(final long id, final byte[] src, final long offset, final int length, final int codepage) throws UnsupportedEncodingException Creates a Property instance by reading its bytes from the property set stream.
| |
| Property | back to summary |
|---|---|
| public Property(final long id, LittleEndianByteArrayInputStream leis, final int length, final int codepage) throws UnsupportedEncodingException Creates a Property instance by reading its bytes from the property set stream.
| |
| decodeValueFromID | back to summary |
|---|---|
| private String decodeValueFromID() | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Compares two properties. Please beware that a property with ID == 0 is a special case: It does not have a type, and its value is the section's dictionary. Another special case are strings: Two properties may have the different types Variant.VT_LPSTR and Variant.VT_LPWSTR;
| |
| getID | back to summary |
|---|---|
| public long getID() Returns the property's ID.
| |
| getSize | back to summary |
|---|---|
| protected int getSize(int property) throws WritingNotSupportedException Returns the property's size in bytes. This is always a multiple of 4.
| |
| getType | back to summary |
|---|---|
| public long getType() Returns the property's type.
| |
| getValue | back to summary |
|---|---|
| public Object getValue() Returns the property's value.
| |
| getVariantName | back to summary |
|---|---|
| private String getVariantName() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| setID | back to summary |
|---|---|
| public void setID(final long id) Sets the property's ID.
| |
| setType | back to summary |
|---|---|
| public void setType(final long type) Sets the property's type.
| |
| setValue | back to summary |
|---|---|
| public void setValue(final Object value) Sets the property's value.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| toString | back to summary |
|---|---|
| public String toString(int codepage, PropertyIDMap idMap) | |
| typesAreEqual | back to summary |
|---|---|
| private boolean typesAreEqual(final long t1, final long t2) | |
| unpaddedLength | back to summary |
|---|---|
| private static int unpaddedLength(byte[] buf) Byte arrays can be 0-padded up to 3 bytes to form a full quad array. This returns the truncated length without the potentially 0-padded bytes
| |
| write | back to summary |
|---|---|
| public int write(final OutputStream out, final int codepage) throws IOException, WritingNotSupportedException Writes the property to an output stream.
| |