Top Description Fields Constructors Methods
org.apache.poi.poifs.property

public abstract Class Property

extends Object
implements Child, POIFSViewable
Class Inheritance
All Implemented Interfaces
org.apache.poi.poifs.dev.POIFSViewable, org.apache.poi.poifs.property.Child
Known Direct Subclasses
org.apache.poi.poifs.property.DirectoryProperty, org.apache.poi.poifs.property.DocumentProperty
Imports
java.io.IOException, .OutputStream, java.util.Arrays, .Collections, .Iterator, org.apache.poi.hpsf.ClassID, org.apache.poi.poifs.common.POIFSConstants, org.apache.poi.poifs.dev.POIFSViewable, org.apache.poi.util.ByteField, .IntegerField, .LittleEndianConsts, .ShortField

This abstract base class is the ancestor of all classes implementing POIFS Property behavior.

Field Summary

Modifier and TypeField and Description
private static final int
private IntegerField
private static final int
private IntegerField
private static final int
private IntegerField
private static final int
private static final byte
private int
private static final int
private String
private ShortField
private static final int
private Child
private IntegerField
private static final int
protected static final int
protected static final byte
private ByteField
private static final int
protected static final byte
private Child
private IntegerField
private static final int
private ByteField
private byte[]
private IntegerField
private static final int
private IntegerField
private static final int
private IntegerField
private static final int
private IntegerField
private static final int
private ClassID
private static final int
private IntegerField
private static final int

Constructor Summary

AccessConstructor and Description
protected
protected
Property(int
index number
index
,
byte[]
byte data
array
,
int
offset into byte data
offset
)

Constructor from byte data

Method Summary

Modifier and TypeMethod and Description
protected int

Returns:

child property index
getChildIndex
()

Get the child property (its index in the Property Table)

protected int

Returns:

the index of this Property within its Property Table
getIndex
()

get the index for this Property

public String

Returns:

property name as String
getName
()

Get the name of this property

public Child

Returns:

the next Child; may return null
getNextChild
()

Implements org.apache.poi.poifs.property.Child.getNextChild.

Get the next Child, if any

pack-priv int

Returns:

index of next sibling
getNextChildIndex
()

get the next sibling

public Child

Returns:

the previous Child; may return null
getPreviousChild
()

Implements org.apache.poi.poifs.property.Child.getPreviousChild.

Get the previous Child, if any

pack-priv int

Returns:

index of previous sibling
getPreviousChildIndex
()

get the previous sibling

public String

Returns:

short description
getShortDescription
()

Implements org.apache.poi.poifs.dev.POIFSViewable.getShortDescription.

Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.

public int

Returns:

size in bytes
getSize
()

find out the document size

public int

Returns:

the start block
getStartBlock
()

public ClassID

Returns:

storage Class ID for this property stream
getStorageClsid
()

Sets the storage clsid, which is the Class ID of a COM object which reads and writes this stream

public Object[]

Returns:

an array of Object; may not be null, but may be empty
getViewableArray
()

Implements org.apache.poi.poifs.dev.POIFSViewable.getViewableArray.

Get an array of objects, some of which may implement POIFSViewable

public Iterator<Object>

Returns:

an Iterator; may not be null, but may have an empty back end store
getViewableIterator
()

Implements org.apache.poi.poifs.dev.POIFSViewable.getViewableIterator.

Get an Iterator of objects, some of which may implement POIFSViewable

public abstract boolean

Returns:

true if a directory type Property
isDirectory
()

public static boolean

Returns:

true if the length is less than _big_block_minimum_bytes
isSmall
(int
length in bytes
length
)

does the length indicate a small document?

pack-priv static boolean

Returns:

true if the index is valid
isValidIndex
(int
value to be checked
index
)

determine whether the specified index is valid

public boolean

Returns:

true if a viewer should call getViewableArray, false if a viewer should call getViewableIterator
preferArray
()

Implements org.apache.poi.poifs.dev.POIFSViewable.preferArray.

Give viewers a hint as to whether to call getViewableArray or getViewableIterator

protected abstract void
preWrite()

Perform whatever activities need to be performed prior to writing

protected void
setChildProperty(int
the child property's index in the Property Table
child
)

Set the child property.

protected void
setIndex(int
this Property's index within its containing Property Table
index
)

Set the index for this Property

protected void
setName(String
the new name
name
)

Set the name; silently truncates the name if it's too long.

public void
setNextChild(Child
the new 'next' child; may be null, which has the effect of saying there is no 'next' child
child
)

Implements org.apache.poi.poifs.property.Child.setNextChild.

Set the next Child

protected void
setNodeColor(byte
the node color (red or black)
nodeColor
)

Set the node color.

public void
setPreviousChild(Child
the new 'previous' child; may be null, which has the effect of saying there is no 'previous' child
child
)

Implements org.apache.poi.poifs.property.Child.setPreviousChild.

Set the previous Child

protected void
setPropertyType(byte
the property type (root, file, directory)
propertyType
)

Set the property type.

protected void
setSize(int
the size of the document, in bytes
size
)

Set the size of the document associated with this Property

public void
setStartBlock(int
the start block index
startBlock
)

Set the start block for the document referred to by this Property.

public void
setStorageClsid(ClassID
Storage Class ID
clsidStorage
)

Sets the storage class ID for this property stream.

public boolean

Returns:

true if the size is less than _big_block_minimum_bytes
shouldUseSmallBlocks
()

Based on the currently defined size, should this property use small blocks?

public void
writeData(OutputStream
the OutputStream to which the data should be written.
stream
)

Write the raw data to an OutputStream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_big_block_minimum_bytesback to summary
private static final int _big_block_minimum_bytes
_child_propertyback to summary
private IntegerField _child_property
_child_property_offsetback to summary
private static final int _child_property_offset
_days_1back to summary
private IntegerField _days_1
_days_1_offsetback to summary
private static final int _days_1_offset
_days_2back to summary
private IntegerField _days_2
_days_2_offsetback to summary
private static final int _days_2_offset
_default_fillback to summary
private static final byte _default_fill
_indexback to summary
private int _index
_max_name_lengthback to summary
private static final int _max_name_length
_nameback to summary
private String _name
_name_sizeback to summary
private ShortField _name_size
_name_size_offsetback to summary
private static final int _name_size_offset
_next_childback to summary
private Child _next_child
_next_propertyback to summary
private IntegerField _next_property
_next_property_offsetback to summary
private static final int _next_property_offset
_NO_INDEXback to summary
protected static final int _NO_INDEX
_NODE_BLACKback to summary
protected static final byte _NODE_BLACK
_node_colorback to summary
private ByteField _node_color
_node_color_offsetback to summary
private static final int _node_color_offset
_NODE_REDback to summary
protected static final byte _NODE_RED
_previous_childback to summary
private Child _previous_child
_previous_propertyback to summary
private IntegerField _previous_property
_previous_property_offsetback to summary
private static final int _previous_property_offset
_property_typeback to summary
private ByteField _property_type
_raw_databack to summary
private byte[] _raw_data
_seconds_1back to summary
private IntegerField _seconds_1
_seconds_1_offsetback to summary
private static final int _seconds_1_offset
_seconds_2back to summary
private IntegerField _seconds_2
_seconds_2_offsetback to summary
private static final int _seconds_2_offset
_sizeback to summary
private IntegerField _size
_size_offsetback to summary
private static final int _size_offset
_start_blockback to summary
private IntegerField _start_block
_start_block_offsetback to summary
private static final int _start_block_offset
_storage_clsidback to summary
private ClassID _storage_clsid
_storage_clsid_offsetback to summary
private static final int _storage_clsid_offset
_user_flagsback to summary
private IntegerField _user_flags
_user_flags_offsetback to summary
private static final int _user_flags_offset

Constructor Detail

Propertyback to summary
protected Property()
Propertyback to summary
protected Property(int index, byte[] array, int offset)

Constructor from byte data

Parameters
index:int

index number

array:byte[]

byte data

offset:int

offset into byte data

Method Detail

getChildIndexback to summary
protected int getChildIndex()

Get the child property (its index in the Property Table)

Returns:int

child property index

getIndexback to summary
protected int getIndex()

get the index for this Property

Returns:int

the index of this Property within its Property Table

getNameback to summary
public String getName()

Get the name of this property

Returns:String

property name as String

getNextChildback to summary
public Child getNextChild()

Implements org.apache.poi.poifs.property.Child.getNextChild.

Get the next Child, if any

Returns:Child

the next Child; may return null

getNextChildIndexback to summary
pack-priv int getNextChildIndex()

get the next sibling

Returns:int

index of next sibling

getPreviousChildback to summary
public Child getPreviousChild()

Implements org.apache.poi.poifs.property.Child.getPreviousChild.

Get the previous Child, if any

Returns:Child

the previous Child; may return null

getPreviousChildIndexback to summary
pack-priv int getPreviousChildIndex()

get the previous sibling

Returns:int

index of previous sibling

getShortDescriptionback to summary
public String getShortDescription()

Implements org.apache.poi.poifs.dev.POIFSViewable.getShortDescription.

Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.

Returns:String

short description

getSizeback to summary
public int getSize()

find out the document size

Returns:int

size in bytes

getStartBlockback to summary
public int getStartBlock()
Returns:int

the start block

getStorageClsidback to summary
public ClassID getStorageClsid()

Sets the storage clsid, which is the Class ID of a COM object which reads and writes this stream

Returns:ClassID

storage Class ID for this property stream

getViewableArrayback to summary
public Object[] getViewableArray()

Implements org.apache.poi.poifs.dev.POIFSViewable.getViewableArray.

Get an array of objects, some of which may implement POIFSViewable

Returns:Object[]

an array of Object; may not be null, but may be empty

getViewableIteratorback to summary
public Iterator<Object> getViewableIterator()

Implements org.apache.poi.poifs.dev.POIFSViewable.getViewableIterator.

Get an Iterator of objects, some of which may implement POIFSViewable

Returns:Iterator<Object>

an Iterator; may not be null, but may have an empty back end store

isDirectoryback to summary
public abstract boolean isDirectory()
Returns:boolean

true if a directory type Property

isSmallback to summary
public static boolean isSmall(int length)

does the length indicate a small document?

Parameters
length:int

length in bytes

Returns:boolean

true if the length is less than _big_block_minimum_bytes

isValidIndexback to summary
pack-priv static boolean isValidIndex(int index)

determine whether the specified index is valid

Parameters
index:int

value to be checked

Returns:boolean

true if the index is valid

preferArrayback to summary
public boolean preferArray()

Implements org.apache.poi.poifs.dev.POIFSViewable.preferArray.

Give viewers a hint as to whether to call getViewableArray or getViewableIterator

Returns:boolean

true if a viewer should call getViewableArray, false if a viewer should call getViewableIterator

preWriteback to summary
protected abstract void preWrite()

Perform whatever activities need to be performed prior to writing

setChildPropertyback to summary
protected void setChildProperty(int child)

Set the child property.

Parameters
child:int

the child property's index in the Property Table

setIndexback to summary
protected void setIndex(int index)

Set the index for this Property

Parameters
index:int

this Property's index within its containing Property Table

setNameback to summary
protected void setName(String name)

Set the name; silently truncates the name if it's too long.

Parameters
name:String

the new name

setNextChildback to summary
public void setNextChild(Child child)

Implements org.apache.poi.poifs.property.Child.setNextChild.

Set the next Child

Parameters
child:Child

the new 'next' child; may be null, which has the effect of saying there is no 'next' child

setNodeColorback to summary
protected void setNodeColor(byte nodeColor)

Set the node color.

Parameters
nodeColor:byte

the node color (red or black)

setPreviousChildback to summary
public void setPreviousChild(Child child)

Implements org.apache.poi.poifs.property.Child.setPreviousChild.

Set the previous Child

Parameters
child:Child

the new 'previous' child; may be null, which has the effect of saying there is no 'previous' child

setPropertyTypeback to summary
protected void setPropertyType(byte propertyType)

Set the property type. Makes no attempt to validate the value.

Parameters
propertyType:byte

the property type (root, file, directory)

setSizeback to summary
protected void setSize(int size)

Set the size of the document associated with this Property

Parameters
size:int

the size of the document, in bytes

setStartBlockback to summary
public void setStartBlock(int startBlock)

Set the start block for the document referred to by this Property.

Parameters
startBlock:int

the start block index

setStorageClsidback to summary
public void setStorageClsid(ClassID clsidStorage)

Sets the storage class ID for this property stream. This is the Class ID of the COM object which can read and write this property stream

Parameters
clsidStorage:ClassID

Storage Class ID

shouldUseSmallBlocksback to summary
public boolean shouldUseSmallBlocks()

Based on the currently defined size, should this property use small blocks?

Returns:boolean

true if the size is less than _big_block_minimum_bytes

writeDataback to summary
public void writeData(OutputStream stream) throws IOException

Write the raw data to an OutputStream.

Parameters
stream:OutputStream

the OutputStream to which the data should be written.

Exceptions
IOException:
on problems writing to the specified stream.