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.7 2002/05/26 22:18:40 acoliver 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)
           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 value's.
protected  int readCodePage(byte[] src, long offset)
           Reads a code page.
protected  java.util.Map readDictionary(byte[] src, long 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,
                long 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.

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 value's.

Returns:
The value value

readDictionary

protected java.util.Map readDictionary(byte[] src,
                                       long 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.
Returns:
Description of the Return Value

readCodePage

protected int readCodePage(byte[] src,
                           long 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.
Returns:
Description of the Return Value

jakarta-poi 1.7.0-dev

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