|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.hpsf.PropertySet
org.apache.poi.hpsf.SpecialPropertySet
Abstract superclass for the convenience classes SummaryInformation
and DocumentSummaryInformation
.
The motivation behind this class is quite nasty if you look
behind the scenes, but it serves the application programmer well by
providing him with the easy-to-use SummaryInformation
and
DocumentSummaryInformation
classes. When parsing the data a
property set stream consists of (possibly coming from an InputStream
) we want to read and process each byte only
once. Since we don't know in advance which kind of property set we
have, we can expect only the most general PropertySet
. Creating a special subclass should be as easy as
calling the special subclass' constructor and pass the general
PropertySet
in. To make things easy internally, the special
class just holds a reference to the general PropertySet
and
delegates all method calls to it.
A cleaner implementation would have been like this: The PropertySetFactory
parses the stream data into some internal
object first. Then it finds out whether the stream is a SummaryInformation
, a DocumentSummaryInformation
or a
general PropertySet
. However, the current implementation
went the other way round historically: the convenience classes came
only late to my mind.
Field Summary |
Fields inherited from class org.apache.poi.hpsf.PropertySet |
byteOrder, classID, format, OS_MACINTOSH, OS_WIN16, OS_WIN32, osVersion, sectionCount, sections |
Constructor Summary | |
SpecialPropertySet(PropertySet ps)
|
Method Summary | |
int |
getByteOrder()
Returns the property set stream's low-level "byte order" field. |
ClassID |
getClassID()
Returns the property set stream's low-level "class ID" field. |
int |
getFormat()
Returns the property set stream's low-level "format" field. |
long |
getOSVersion()
Returns the property set stream's low-level "OS version" field. |
long |
getSectionCount()
Returns the number of Section s in the property
set. |
java.util.List |
getSections()
Returns the Section s in the property set. |
Section |
getSingleSection()
If the PropertySet has only a single section this
method returns it. |
boolean |
isDocumentSummaryInformation()
Checks whether this PropertySet is a Document
Summary Information. |
boolean |
isSummaryInformation()
Checks whether this PropertySet represents a Summary
Information. |
Methods inherited from class org.apache.poi.hpsf.PropertySet |
getProperties, getProperty, getPropertyBooleanValue, getPropertyIntValue, isPropertySetStream, isPropertySetStream, wasNull |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SpecialPropertySet(PropertySet ps)
Method Detail |
public int getByteOrder()
PropertySet
Returns the property set stream's low-level "byte order" field. It is always 0xFFFE .
getByteOrder
in class PropertySet
public int getFormat()
PropertySet
Returns the property set stream's low-level "format" field. It is always 0x0000 .
getFormat
in class PropertySet
public long getOSVersion()
PropertySet
Returns the property set stream's low-level "OS version" field.
FIXME: Return an int
instead
of a long
in the next major version, i.e. when
incompatible changes are allowed.
getOSVersion
in class PropertySet
public ClassID getClassID()
PropertySet
Returns the property set stream's low-level "class ID" field.
getClassID
in class PropertySet
public long getSectionCount()
PropertySet
Returns the number of Section
s in the property
set.
FIXME: Return an int
instead
of a long
in the next major version, i.e. when
incompatible changes are allowed.
getSectionCount
in class PropertySet
Section
s in the property set.public java.util.List getSections()
PropertySet
Returns the Section
s in the property set.
getSections
in class PropertySet
Section
s in the property set.public boolean isSummaryInformation()
PropertySet
Checks whether this PropertySet
represents a Summary
Information.
isSummaryInformation
in class PropertySet
true
if this PropertySet
represents a Summary Information, else false
.public boolean isDocumentSummaryInformation()
PropertySet
Checks whether this PropertySet
is a Document
Summary Information.
isDocumentSummaryInformation
in class PropertySet
true
if this PropertySet
represents a Document Summary Information, else false
.public Section getSingleSection()
PropertySet
If the PropertySet
has only a single section this
method returns it.
getSingleSection
in class PropertySet
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |