Java Doc for PropertySet.java in  » Collaboration » poi-3.0.2-beta2 » org » apache » poi » hpsf » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.poi.hpsf.PropertySet

All known Subclasses:   org.apache.poi.hpsf.MutablePropertySet,
PropertySet
public class PropertySet (Code)

Represents a property set in the Horrible Property Set Format (HPSF). These are usually metadata of a Microsoft Office document.

An application that wants to access these metadata should create an instance of this class or one of its subclasses by calling the factory method PropertySetFactory.create and then retrieve the information its needs by calling appropriate methods.

PropertySetFactory.create does its work by calling one of the constructors PropertySet.PropertySet(InputStream) or PropertySet.PropertySet(byte[]) . If the constructor's argument is not in the Horrible Property Set Format, i.e. not a property set stream, or if any other error occurs, an appropriate exception is thrown.

A PropertySet has a list of Section s, and each Section has a Property array. Use PropertySet.getSections to retrieve the Section s, then call Section.getProperties for each Section to get hold of the Property arrays.

Since the vast majority of PropertySet s contains only a single Section , the convenience method PropertySet.getProperties returns the properties of a PropertySet 's Section (throwing a NoSingleSectionException if the PropertySet contains more (or less) than exactly one Section ).


author:
   Rainer Klute author:
   href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de>
author:
   Drew Varner (Drew.Varner hanginIn sc.edu)
version:
   $Id: PropertySet.java 489730 2006-12-22 19:18:16Z bayard $
since:
   2002-02-09


Field Summary
final static  byte[]BYTE_ORDER_ASSERTION
    
final static  byte[]FORMAT_ASSERTION
    
final public static  intOS_MACINTOSH
    
final public static  intOS_WIN16
    
final public static  intOS_WIN32
    
protected  intbyteOrder
    

Specifies this PropertySet 's byte order.

protected  ClassIDclassID
    

Specifies this PropertySet 's "classID" field.

protected  intformat
    

Specifies this PropertySet 's format.

protected  intosVersion
    

Specifies the version of the operating system that created this PropertySet .

protected  Listsections
    

Constructor Summary
protected  PropertySet()
    
public  PropertySet(InputStream stream)
    

Creates a PropertySet instance from an InputStream in the Horrible Property Set Format.

The constructor reads the first few bytes from the stream and determines whether it is really a property set stream.

public  PropertySet(byte[] stream, int offset, int length)
    

Creates a PropertySet instance from a byte array that represents a stream in the Horrible Property Set Format.


Parameters:
  stream - The byte array holding the stream data.
Parameters:
  offset - The offset in stream where the streamdata begin.
public  PropertySet(byte[] stream)
    

Creates a PropertySet instance from a byte array that represents a stream in the Horrible Property Set Format.


Parameters:
  stream - The byte array holding the stream data.

Method Summary
public  booleanequals(Object o)
    
public  intgetByteOrder()
    

Returns the property set stream's low-level "byte order" field.

public  ClassIDgetClassID()
    
public  SectiongetFirstSection()
    
public  intgetFormat()
    

Returns the property set stream's low-level "format" field.

public  intgetOSVersion()
    
public  Property[]getProperties()
    

Convenience method returning the Property array contained in this property set.

protected  ObjectgetProperty(int id)
    

Convenience method returning the value of the property with the specified ID.

protected  booleangetPropertyBooleanValue(int id)
    

Convenience method returning the value of a boolean property with the specified ID.

protected  intgetPropertyIntValue(int id)
    

Convenience method returning the value of the numeric property with the specified ID.

public  intgetSectionCount()
    
public  ListgetSections()
    
public  SectiongetSingleSection()
    
public  inthashCode()
    
public  booleanisDocumentSummaryInformation()
    
public static  booleanisPropertySetStream(InputStream stream)
    

Checks whether an InputStream is in the Horrible Property Set Format.


Parameters:
  stream - The InputStream to check.
public static  booleanisPropertySetStream(byte[] src, int offset, int length)
    

Checks whether a byte array is in the Horrible Property Set Format.


Parameters:
  src - The byte array to check.
Parameters:
  offset - The offset in the byte array.
Parameters:
  length - The significant number of bytes in the bytearray.
public  booleanisSummaryInformation()
    
public  StringtoString()
    
public  booleanwasNull()
    

Checks whether the property which the last call to PropertySet.getPropertyIntValue or PropertySet.getProperty tried to access was available or not.


Field Detail
BYTE_ORDER_ASSERTION
final static byte[] BYTE_ORDER_ASSERTION(Code)

The "byteOrder" field must equal this value.




FORMAT_ASSERTION
final static byte[] FORMAT_ASSERTION(Code)

The "format" field must equal this value.




OS_MACINTOSH
final public static int OS_MACINTOSH(Code)

If the OS version field holds this value the property set stream was created on a Macintosh system.




OS_WIN16
final public static int OS_WIN16(Code)

If the OS version field holds this value the property set stream was created on a 16-bit Windows system.




OS_WIN32
final public static int OS_WIN32(Code)

If the OS version field holds this value the property set stream was created on a 32-bit Windows system.




byteOrder
protected int byteOrder(Code)

Specifies this PropertySet 's byte order. See the HPFS documentation for details!




classID
protected ClassID classID(Code)

Specifies this PropertySet 's "classID" field. See the HPFS documentation for details!




format
protected int format(Code)

Specifies this PropertySet 's format. See the HPFS documentation for details!




osVersion
protected int osVersion(Code)

Specifies the version of the operating system that created this PropertySet . See the HPFS documentation for details!




sections
protected List sections(Code)

The sections in this PropertySet .





Constructor Detail
PropertySet
protected PropertySet()(Code)

Creates an empty (uninitialized) PropertySet .

Please note: For the time being this constructor is protected since it is used for internal purposes only, but expect it to become public once the property set's writing functionality is implemented.




PropertySet
public PropertySet(InputStream stream) throws NoPropertySetStreamException, MarkUnsupportedException, IOException, UnsupportedEncodingException(Code)

Creates a PropertySet instance from an InputStream in the Horrible Property Set Format.

The constructor reads the first few bytes from the stream and determines whether it is really a property set stream. If it is, it parses the rest of the stream. If it is not, it resets the stream to its beginning in order to let other components mess around with the data and throws an exception.


Parameters:
  stream - Holds the data making out the property setstream.
throws:
  MarkUnsupportedException - if the stream does not supportthe InputStream.markSupported method.
throws:
  IOException - if the InputStream cannot not beaccessed as needed.
exception:
  NoPropertySetStreamException - if the input stream does notcontain a property set.
exception:
  UnsupportedEncodingException - if a character encoding is notsupported.



PropertySet
public PropertySet(byte[] stream, int offset, int length) throws NoPropertySetStreamException, UnsupportedEncodingException(Code)

Creates a PropertySet instance from a byte array that represents a stream in the Horrible Property Set Format.


Parameters:
  stream - The byte array holding the stream data.
Parameters:
  offset - The offset in stream where the streamdata begin. If the stream data begin with the first byte in thearray, the offset is 0.
Parameters:
  length - The length of the stream data.
throws:
  NoPropertySetStreamException - if the byte array is not aproperty set stream.
exception:
  UnsupportedEncodingException - if the codepage is not supported.



PropertySet
public PropertySet(byte[] stream) throws NoPropertySetStreamException, UnsupportedEncodingException(Code)

Creates a PropertySet instance from a byte array that represents a stream in the Horrible Property Set Format.


Parameters:
  stream - The byte array holding the stream data. Thecomplete byte array contents is the stream data.
throws:
  NoPropertySetStreamException - if the byte array is not aproperty set stream.
exception:
  UnsupportedEncodingException - if the codepage is not supported.




Method Detail
equals
public boolean equals(Object o)(Code)

Returns true if the PropertySet is equal to the specified parameter, else false.


Parameters:
  o - the object to compare this PropertySet with true if the objects are equal, falseif not



getByteOrder
public int getByteOrder()(Code)

Returns the property set stream's low-level "byte order" field. It is always 0xFFFE .

The property set stream's low-level "byte order" field.



getClassID
public ClassID getClassID()(Code)

Returns the property set stream's low-level "class ID" field.

The property set stream's low-level "class ID" field.



getFirstSection
public Section getFirstSection()(Code)

Gets the PropertySet 's first section.

The PropertySet's first section.



getFormat
public int getFormat()(Code)

Returns the property set stream's low-level "format" field. It is always 0x0000 .

The property set stream's low-level "format" field.



getOSVersion
public int getOSVersion()(Code)

Returns the property set stream's low-level "OS version" field.

The property set stream's low-level "OS version" field.



getProperties
public Property[] getProperties() throws NoSingleSectionException(Code)

Convenience method returning the Property array contained in this property set. It is a shortcut for getting the PropertySet 's Section s list and then getting the Property array from the first Section .

The properties of the only Section of thisPropertySet.
throws:
  NoSingleSectionException - if the PropertySet hasmore or less than one Section.



getProperty
protected Object getProperty(int id) throws NoSingleSectionException(Code)

Convenience method returning the value of the property with the specified ID. If the property is not available, null is returned and a subsequent call to PropertySet.wasNull will return true .


Parameters:
  id - The property ID The property value
throws:
  NoSingleSectionException - if the PropertySet hasmore or less than one Section.



getPropertyBooleanValue
protected boolean getPropertyBooleanValue(int id) throws NoSingleSectionException(Code)

Convenience method returning the value of a boolean property with the specified ID. If the property is not available, false is returned. A subsequent call to PropertySet.wasNull will return true to let the caller distinguish that case from a real property value of false.


Parameters:
  id - The property ID The property value
throws:
  NoSingleSectionException - if the PropertySet hasmore or less than one Section.



getPropertyIntValue
protected int getPropertyIntValue(int id) throws NoSingleSectionException(Code)

Convenience method returning the value of the numeric property with the specified ID. If the property is not available, 0 is returned. A subsequent call to PropertySet.wasNull will return true to let the caller distinguish that case from a real property value of 0.


Parameters:
  id - The property ID The propertyIntValue value
throws:
  NoSingleSectionException - if the PropertySet hasmore or less than one Section.



getSectionCount
public int getSectionCount()(Code)

Returns the number of Section s in the property set.

The number of Sections in the property set.



getSections
public List getSections()(Code)

Returns the Section s in the property set.

The Sections in the property set.



getSingleSection
public Section getSingleSection()(Code)

If the PropertySet has only a single section this method returns it.

The singleSection value



hashCode
public int hashCode()(Code)

See Also:   Object.hashCode



isDocumentSummaryInformation
public boolean isDocumentSummaryInformation()(Code)

Checks whether this PropertySet is a Document Summary Information.

true if this PropertySetrepresents a Document Summary Information, else false.



isPropertySetStream
public static boolean isPropertySetStream(InputStream stream) throws MarkUnsupportedException, IOException(Code)

Checks whether an InputStream is in the Horrible Property Set Format.


Parameters:
  stream - The InputStream to check. In order toperform the check, the method reads the first bytes from thestream. After reading, the stream is reset to the position ithad before reading. The InputStream must support theInputStream.mark method. true if the stream is a property setstream, else false.
throws:
  MarkUnsupportedException - if the InputStreamdoes not support the InputStream.mark method.
exception:
  IOException - if an I/O error occurs



isPropertySetStream
public static boolean isPropertySetStream(byte[] src, int offset, int length)(Code)

Checks whether a byte array is in the Horrible Property Set Format.


Parameters:
  src - The byte array to check.
Parameters:
  offset - The offset in the byte array.
Parameters:
  length - The significant number of bytes in the bytearray. Only this number of bytes will be checked. true if the byte array is a property setstream, false if not.



isSummaryInformation
public boolean isSummaryInformation()(Code)

Checks whether this PropertySet represents a Summary Information.

true if this PropertySetrepresents a Summary Information, else false.



toString
public String toString()(Code)

See Also:   Object.toString



wasNull
public boolean wasNull() throws NoSingleSectionException(Code)

Checks whether the property which the last call to PropertySet.getPropertyIntValue or PropertySet.getProperty tried to access was available or not. This information might be important for callers of PropertySet.getPropertyIntValue since the latter returns 0 if the property does not exist. Using PropertySet.wasNull , the caller can distiguish this case from a property's real value of 0.

true if the last call to PropertySet.getPropertyIntValue or PropertySet.getProperty tried to access aproperty that was not available, else false.
throws:
  NoSingleSectionException - if the PropertySet hasmore than one Section.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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