org.apache.poi.hpsf
Class Property

java.lang.Object
  |
  +--org.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 of other types than those mentioned above and the dictionary property is not yet implemented.

Since:
2002-02-09
Version:
$Id: Property.java,v 1.1 2002/02/14 04:00:59 mjohnson Exp $
Author:
Rainer Klute (klute@rainer-klute.de)
See Also:
Section, Variant

Constructor Summary
Property(int id, byte[] src, int offset, int length)
          Creates a Property instance by reading its bytes from the property set stream.
 
Method Summary
 int getID()
          Returns the property's ID.
 int getType()
          Returns the property's type.
 java.lang.Object getValue()
          Returns the property value's.
protected  int readCodePage(byte[] src, int offset)
          Reads a code page.
protected  java.util.Map readDictionary(byte[] src, int offset, int length)
          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,
                int offset,
                int length)

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. list.
Method Detail

getID

public int getID()

Returns the property's ID.


getType

public int getType()

Returns the property's type.


getValue

public java.lang.Object getValue()

Returns the property value's.


readDictionary

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

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.

readCodePage

protected int readCodePage(byte[] src,
                           int offset)

Reads a code page.

Parameters:
src - The byte array containing the bytes making out the code page.
offset - At this offset within src the code page starts.


Copyright © 2002 Apache jakarta-poi project. All Rights Reserved.