org.apache.poi.hpsf
Class Property

java.lang.Object
  extended byorg.apache.poi.hpsf.Property

public class Property
extends java.lang.Object

A property in a 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).

FIXME: Reading is not implemented for all Variant types yet. Feel free to submit error reports or patches for the types you need.

Since:
2002-02-09
Version:
$Id: Property.java,v 1.10.6.1 2004/02/22 11:54:45 glens Exp $
Author:
Rainer Klute (klute@rainer-klute.de), Drew Varner (Drew.Varner InAndAround sc.edu)
See Also:
Section, Variant

Constructor Summary
Property(int id, byte[] src, long offset, int length, int codepage)
          Creates a Property instance by reading its bytes from the property set stream.
 
Method Summary
 int getID()
          Returns the property's ID.
 long getType()
          Returns the property's type.
 java.lang.Object getValue()
          Returns the property's value.
protected  java.util.Map readDictionary(byte[] src, long offset, int length, int codepage)
          Reads a dictionary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Property

public Property(int id,
                byte[] src,
                long offset,
                int length,
                int codepage)

Creates a Property instance by reading its bytes from the property set stream.

Parameters:
id - The property's ID.
src - The bytes the property set stream consists of.
offset - The property's type/value pair's offset in the section.
length - The property's type/value pair's length in bytes.
codepage - The section's and thus the property's codepage. It is needed only when reading string values.
Method Detail

getID

public int getID()

Returns the property's ID.

Returns:
The ID value

getType

public long getType()

Returns the property's type.

Returns:
The type value

getValue

public java.lang.Object getValue()

Returns the property's value.

Returns:
The property's value

readDictionary

protected java.util.Map readDictionary(byte[] src,
                                       long offset,
                                       int length,
                                       int codepage)

Reads a dictionary.

Parameters:
src - The byte array containing the bytes making out the dictionary.
offset - At this offset within src the dictionary starts.
length - The dictionary contains at most this many bytes.
codepage - The codepage of the string values.
Returns:
The dictonary


Copyright © 2003 Apache Software Foundation.