org.apache.poi.hpsf

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Collaboration » poi 3.0.2 beta2 » org.apache.poi.hpsf 
org.apache.poi.hpsf
HPSF

Processes streams in the Horrible Property Set Format (HPSF) in POI filesystems. Microsoft Office documents, i.e. POI filesystems, usually contain meta data like author, title, last saving time etc. These items are called properties and stored in property set streams along with the document itself. These streams are commonly named \005SummaryInformation and \005DocumentSummaryInformation. However, a POI filesystem may contain further property sets of other names or types.

In order to extract the properties from a POI filesystem, a property set stream's contents must be parsed into a {@link org.apache.poi.hpsf.PropertySet} instance. Its subclasses {@link org.apache.poi.hpsf.SummaryInformation} and {@link org.apache.poi.hpsf.DocumentSummaryInformation} deal with the well-known property set streams \005SummaryInformation and \005DocumentSummaryInformation. (However, the streams' names are irrelevant. What counts is the property set's first section's format ID - see below.)

The factory method {@link org.apache.poi.hpsf.PropertySetFactory#create} creates a {@link org.apache.poi.hpsf.PropertySet} instance. This method always returns the most specific property set: If it identifies the stream data as a Summary Information or as a Document Summary Information it returns an instance of the corresponding class, else the general {@link org.apache.poi.hpsf.PropertySet}.

A {@link org.apache.poi.hpsf.PropertySet} contains a list of {@link org.apache.poi.hpsf.Section}s which can be retrieved with {@link org.apache.poi.hpsf.PropertySet#getSections}. Each {@link org.apache.poi.hpsf.Section} contains a {@link org.apache.poi.hpsf.Property} array which can be retrieved with {@link org.apache.poi.hpsf.Section#getProperties}. Since the vast majority of {@link org.apache.poi.hpsf.PropertySet}s contains only a single {@link org.apache.poi.hpsf.Section}, the convenience method {@link org.apache.poi.hpsf.PropertySet#getProperties} returns the properties of a {@link org.apache.poi.hpsf.PropertySet}'s {@link org.apache.poi.hpsf.Section} (throwing a {@link org.apache.poi.hpsf.NoSingleSectionException} if the {@link org.apache.poi.hpsf.PropertySet} contains more (or less) than exactly one {@link org.apache.poi.hpsf.Section}).

Each {@link org.apache.poi.hpsf.Property} has an ID, a type, and a value which can be retrieved with {@link org.apache.poi.hpsf.Property#getID}, {@link org.apache.poi.hpsf.Property#getType}, and {@link org.apache.poi.hpsf.Property#getValue}, respectively. The value's class depends on the property's type. The current implementation does not yet support all property types and restricts the values' classes to {@link java.lang.String}, {@link java.lang.Integer} and {@link java.util.Date}. A value of a yet unknown type is returned as a byte array containing the value's origin bytes from the property set stream.

To retrieve the value of a specific {@link org.apache.poi.hpsf.Property}, use {@link org.apache.poi.hpsf.Section#getProperty} or {@link org.apache.poi.hpsf.Section#getPropertyIntValue}.

The {@link org.apache.poi.hpsf.SummaryInformation} and {@link org.apache.poi.hpsf.DocumentSummaryInformation} classes provide convenience methods for retrieving well-known properties. For example, an application that wants to retrieve a document's title string just calls {@link org.apache.poi.hpsf.SummaryInformation#getTitle} instead of going through the hassle of first finding out what the title's property ID is and then using this ID to get the property's value.

Writing properties can be done with the classes {@link org.apache.poi.hpsf.MutablePropertySet}, {@link org.apache.poi.hpsf.MutableSection}, and {@link org.apache.poi.hpsf.MutableProperty}.

Public documentation from Microsoft can be found in the appropriate section of the MSDN Library.

History

2003-09-11:

{@link org.apache.poi.hpsf.PropertySetFactory#create(InputStream)} no longer throws an {@link org.apache.poi.hpsf.UnexpectedPropertySetTypeException}.

To Do

The following is still left to be implemented. Sponsering could foster these issues considerably.

  • Convenience methods for setting summary information and document summary information properties

  • Better codepage support

  • Support for more property (variant) types

@author Rainer Klute (klute@rainer-klute.de) @version $Id: package.html 496526 2007-01-15 22:46:35Z markt $ @since 2002-02-09

Java Source File NameTypeComment
ClassID.javaClass

Represents a class ID (16 bytes).

Constants.javaClass
CustomProperties.javaClass

Maintains the instances of CustomProperty that belong to a DocumentSummaryInformation .

CustomProperty.javaClass

This class represents custum properties in the document summary information stream.

DocumentSummaryInformation.javaClass
HPSFException.javaClass

This exception is the superclass of all other checked exceptions thrown in this package.

HPSFRuntimeException.javaClass

This exception is the superclass of all other unchecked exceptions thrown in this package.

IllegalPropertySetDataException.javaClass

This exception is thrown when there is an illegal value set in a PropertySet .

IllegalVariantTypeException.javaClass
MarkUnsupportedException.javaClass
MissingSectionException.javaClass
MutableProperty.javaClass
MutablePropertySet.javaClass
MutableSection.javaClass
NoFormatIDException.javaClass

This exception is thrown if a MutablePropertySet is to be written but does not have a formatID set (see MutableSection.setFormatID(ClassID) or org.apache.poi.hpsf.MutableSection.setFormatID(byte[]) .

NoPropertySetStreamException.javaClass
NoSingleSectionException.javaClass
Property.javaClass

A property in a Section of a PropertySet .

The property's ID gives the property a meaning in the context of its Section .

PropertySet.javaClass

Represents a property set in the Horrible Property Set Format (HPSF).

PropertySetFactory.javaClass
ReadingNotSupportedException.javaClass
Section.javaClass
SpecialPropertySet.javaClass

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.

SummaryInformation.javaClass
Thumbnail.javaClass
TypeWriter.javaClass
UnexpectedPropertySetTypeException.javaClass

This exception is thrown if a certain type of property set is expected (e.g.

UnsupportedVariantTypeException.javaClass

This exception is thrown if HPSF encounters a variant type that isn't supported yet.

Util.javaClass
Variant.javaClass

The Variant types as defined by Microsoft's COM.

VariantSupport.javaClass

Supports reading and writing of variant data.

FIXME (3): Reading and writing should be made more uniform than it is now.

VariantTypeException.javaClass

This exception is thrown if HPSF encounters a problem with a variant type.

WritingNotSupportedException.javaClass
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.