Package org.apache.poi.poifs.property
Class Property
- java.lang.Object
-
- org.apache.poi.poifs.property.Property
-
- All Implemented Interfaces:
POIFSViewable,Child
- Direct Known Subclasses:
DirectoryProperty,DocumentProperty
public abstract class Property extends java.lang.Object implements Child, POIFSViewable
This abstract base class is the ancestor of all classes implementing POIFS Property behavior.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Get the name of this propertyChildgetNextChild()Get the next Child, if anyChildgetPreviousChild()Get the previous Child, if anyjava.lang.StringgetShortDescription()Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.intgetSize()find out the document sizeintgetStartBlock()ClassIDgetStorageClsid()Sets the storage clsid, which is the Class ID of a COM object which reads and writes this streamjava.lang.Object[]getViewableArray()Get an array of objects, some of which may implement POIFSViewablejava.util.Iterator<java.lang.Object>getViewableIterator()Get an Iterator of objects, some of which may implement POIFSViewableabstract booleanisDirectory()static booleanisSmall(int length)does the length indicate a small document?booleanpreferArray()Give viewers a hint as to whether to call getViewableArray or getViewableIteratorvoidsetNextChild(Child child)Set the next ChildvoidsetPreviousChild(Child child)Set the previous ChildvoidsetStartBlock(int startBlock)Set the start block for the document referred to by this Property.voidsetStorageClsid(ClassID clsidStorage)Sets the storage class ID for this property stream.booleanshouldUseSmallBlocks()Based on the currently defined size, should this property use small blocks?voidwriteData(java.io.OutputStream stream)Write the raw data to an OutputStream.
-
-
-
Method Detail
-
writeData
public void writeData(java.io.OutputStream stream) throws java.io.IOExceptionWrite the raw data to an OutputStream.- Parameters:
stream- the OutputStream to which the data should be written.- Throws:
java.io.IOException- on problems writing to the specified stream.
-
setStartBlock
public void setStartBlock(int startBlock)
Set the start block for the document referred to by this Property.- Parameters:
startBlock- the start block index
-
getStartBlock
public int getStartBlock()
- Returns:
- the start block
-
getSize
public int getSize()
find out the document size- Returns:
- size in bytes
-
shouldUseSmallBlocks
public boolean shouldUseSmallBlocks()
Based on the currently defined size, should this property use small blocks?- Returns:
- true if the size is less than _big_block_minimum_bytes
-
isSmall
public static boolean isSmall(int length)
does the length indicate a small document?- Parameters:
length- length in bytes- Returns:
- true if the length is less than _big_block_minimum_bytes
-
getName
public java.lang.String getName()
Get the name of this property- Returns:
- property name as String
-
isDirectory
public abstract boolean isDirectory()
- Returns:
- true if a directory type Property
-
getStorageClsid
public ClassID getStorageClsid()
Sets the storage clsid, which is the Class ID of a COM object which reads and writes this stream- Returns:
- storage Class ID for this property stream
-
setStorageClsid
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- Storage Class ID
-
getNextChild
public Child getNextChild()
Get the next Child, if any- Specified by:
getNextChildin interfaceChild- Returns:
- the next Child; may return null
-
getPreviousChild
public Child getPreviousChild()
Get the previous Child, if any- Specified by:
getPreviousChildin interfaceChild- Returns:
- the previous Child; may return null
-
setNextChild
public void setNextChild(Child child)
Set the next Child- Specified by:
setNextChildin interfaceChild- Parameters:
child- the new 'next' child; may be null, which has the effect of saying there is no 'next' child
-
setPreviousChild
public void setPreviousChild(Child child)
Set the previous Child- Specified by:
setPreviousChildin interfaceChild- Parameters:
child- the new 'previous' child; may be null, which has the effect of saying there is no 'previous' child
-
getViewableArray
public java.lang.Object[] getViewableArray()
Get an array of objects, some of which may implement POIFSViewable- Specified by:
getViewableArrayin interfacePOIFSViewable- Returns:
- an array of Object; may not be null, but may be empty
-
getViewableIterator
public java.util.Iterator<java.lang.Object> getViewableIterator()
Get an Iterator of objects, some of which may implement POIFSViewable- Specified by:
getViewableIteratorin interfacePOIFSViewable- Returns:
- an Iterator; may not be null, but may have an empty back end store
-
preferArray
public boolean preferArray()
Give viewers a hint as to whether to call getViewableArray or getViewableIterator- Specified by:
preferArrayin interfacePOIFSViewable- Returns:
- true if a viewer should call getViewableArray, false if a viewer should call getViewableIterator
-
getShortDescription
public java.lang.String getShortDescription()
Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.- Specified by:
getShortDescriptionin interfacePOIFSViewable- Returns:
- short description
-
-