public abstract class Property extends Object implements Child, POIFSViewable
Modifier | Constructor and Description |
---|---|
protected |
Property()
Default constructor
|
protected |
Property(int index,
byte[] array,
int offset)
Constructor from byte data
|
Modifier and Type | Method and Description |
---|---|
protected int |
getChildIndex()
Get the child property (its index in the Property Table)
|
protected int |
getIndex()
get the index for this Property
|
String |
getName()
Get the name of this property
|
Child |
getNextChild()
Get the next Child, if any
|
(package private) int |
getNextChildIndex()
get the next sibling
|
Child |
getPreviousChild()
Get the previous Child, if any
|
(package private) int |
getPreviousChildIndex()
get the previous sibling
|
String |
getShortDescription()
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
|
int |
getSize()
find out the document size
|
int |
getStartBlock() |
ClassID |
getStorageClsid()
Sets the storage clsid, which is the Class ID of a COM object which
reads and writes this stream
|
Object[] |
getViewableArray()
Get an array of objects, some of which may implement
POIFSViewable
|
Iterator |
getViewableIterator()
Get an Iterator of objects, some of which may implement
POIFSViewable
|
abstract boolean |
isDirectory() |
static boolean |
isSmall(int length)
does the length indicate a small document?
|
(package private) static boolean |
isValidIndex(int index)
determine whether the specified index is valid
|
boolean |
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 child)
Set the child property.
|
protected void |
setIndex(int index)
Set the index for this Property
|
protected void |
setName(String name)
Set the name; silently truncates the name if it's too long.
|
void |
setNextChild(Child child)
Set the next Child
|
protected void |
setNodeColor(byte nodeColor)
Set the node color.
|
void |
setPreviousChild(Child child)
Set the previous Child
|
protected void |
setPropertyType(byte propertyType)
Set the property type.
|
protected void |
setSize(int size)
Set the size of the document associated with this Property
|
void |
setStartBlock(int startBlock)
Set the start block for the document referred to by this
Property.
|
void |
setStorageClsid(ClassID clsidStorage)
Sets the storage class ID for this property stream.
|
boolean |
shouldUseSmallBlocks()
Based on the currently defined size, should this property use
small blocks?
|
void |
writeData(OutputStream stream)
Write the raw data to an OutputStream.
|
private static final byte _default_fill
private static final int _name_size_offset
private static final int _max_name_length
protected static final int _NO_INDEX
private static final int _node_color_offset
private static final int _previous_property_offset
private static final int _next_property_offset
private static final int _child_property_offset
private static final int _storage_clsid_offset
private static final int _user_flags_offset
private static final int _seconds_1_offset
private static final int _days_1_offset
private static final int _seconds_2_offset
private static final int _days_2_offset
private static final int _start_block_offset
private static final int _size_offset
protected static final byte _NODE_BLACK
protected static final byte _NODE_RED
private static final int _big_block_minimum_bytes
private String _name
private ShortField _name_size
private ByteField _property_type
private ByteField _node_color
private IntegerField _previous_property
private IntegerField _next_property
private IntegerField _child_property
private ClassID _storage_clsid
private IntegerField _user_flags
private IntegerField _seconds_1
private IntegerField _days_1
private IntegerField _seconds_2
private IntegerField _days_2
private IntegerField _start_block
private IntegerField _size
private byte[] _raw_data
private int _index
private Child _next_child
private Child _previous_child
protected Property()
protected Property(int index, byte[] array, int offset)
index
- index numberarray
- byte dataoffset
- offset into byte datapublic void writeData(OutputStream stream) throws IOException
stream
- the OutputStream to which the data should be
written.IOException
- on problems writing to the specified
stream.public void setStartBlock(int startBlock)
startBlock
- the start block indexpublic int getStartBlock()
public int getSize()
public boolean shouldUseSmallBlocks()
public static boolean isSmall(int length)
length
- length in bytespublic String getName()
public abstract boolean isDirectory()
public ClassID getStorageClsid()
protected final void setName(String name)
name
- the new namepublic void setStorageClsid(ClassID clsidStorage)
clsidStorage
- Storage Class IDprotected void setPropertyType(byte propertyType)
propertyType
- the property type (root, file, directory)protected void setNodeColor(byte nodeColor)
nodeColor
- the node color (red or black)protected void setChildProperty(int child)
child
- the child property's index in the Property Tableprotected int getChildIndex()
protected void setSize(int size)
size
- the size of the document, in bytesprotected void setIndex(int index)
index
- this Property's index within its containing
Property Tableprotected int getIndex()
protected abstract void preWrite()
int getNextChildIndex()
int getPreviousChildIndex()
static boolean isValidIndex(int index)
index
- value to be checkedpublic Child getNextChild()
getNextChild
in interface Child
public Child getPreviousChild()
getPreviousChild
in interface Child
public void setNextChild(Child child)
setNextChild
in interface Child
child
- the new 'next' child; may be null, which has the
effect of saying there is no 'next' childpublic void setPreviousChild(Child child)
setPreviousChild
in interface Child
child
- the new 'previous' child; may be null, which has
the effect of saying there is no 'previous' childpublic Object[] getViewableArray()
getViewableArray
in interface POIFSViewable
public Iterator getViewableIterator()
getViewableIterator
in interface POIFSViewable
public boolean preferArray()
preferArray
in interface POIFSViewable
public String getShortDescription()
getShortDescription
in interface POIFSViewable
Copyright © 2015 Open Microscopy Environment