Java Doc for VariantSupport.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.Variant
      org.apache.poi.hpsf.VariantSupport

VariantSupport
public class VariantSupport extends Variant (Code)

Supports reading and writing of variant data.

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

  • Reading requires a length parameter that is 4 byte greater than the actual data, because the variant type field is included.

  • Reading reads from a byte array while writing writes to an byte array output stream.


author:
   Rainer Klute author:
   href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de>
since:
   2003-08-08
version:
   $Id: VariantSupport.java 489730 2006-12-22 19:18:16Z bayard $


Field Summary
protected static  ListunsupportedMessage
    


Method Summary
public static  StringcodepageToEncoding(int codepage)
    

Turns a codepage number into the equivalent character encoding's name.


Parameters:
  codepage - The codepage number The character encoding's name.
public static  booleanisLogUnsupportedTypes()
    

Checks whether logging of unsupported variant types warning is turned on or off.

true if logging is turned on, elsefalse.
public static  Objectread(byte[] src, int offset, int length, long type, int codepage)
    

Reads a variant type from a byte array.


Parameters:
  src - The byte array
Parameters:
  offset - The offset in the byte array where the variantstarts
Parameters:
  length - The length of the variant including the varianttype field
Parameters:
  type - The variant type to read
Parameters:
  codepage - The codepage to use to write non-wide strings A Java object that corresponds best to the variantfield.
public static  voidsetLogUnsupportedTypes(boolean logUnsupportedTypes)
    
public static  intwrite(OutputStream out, long type, Object value, int codepage)
    

Writes a variant value to an output stream.

protected static  voidwriteUnsupportedTypeMessage(UnsupportedVariantTypeException ex)
    

Writes a warning to System.err that a variant type is unsupported by HPSF.


Field Detail
unsupportedMessage
protected static List unsupportedMessage(Code)

Keeps a list of the variant types an "unsupported" message has already been issued for.






Method Detail
codepageToEncoding
public static String codepageToEncoding(int codepage) throws UnsupportedEncodingException(Code)

Turns a codepage number into the equivalent character encoding's name.


Parameters:
  codepage - The codepage number The character encoding's name. If the codepage number is 65001, the encoding name is "UTF-8". All other positive numbers are mapped to"cp" followed by the number, e.g. if the codepage number is 1252 the returned character encoding name will be "cp1252".
exception:
  UnsupportedEncodingException - if the specified codepage isless than zero.



isLogUnsupportedTypes
public static boolean isLogUnsupportedTypes()(Code)

Checks whether logging of unsupported variant types warning is turned on or off.

true if logging is turned on, elsefalse.



read
public static Object read(byte[] src, int offset, int length, long type, int codepage) throws ReadingNotSupportedException, UnsupportedEncodingException(Code)

Reads a variant type from a byte array.


Parameters:
  src - The byte array
Parameters:
  offset - The offset in the byte array where the variantstarts
Parameters:
  length - The length of the variant including the varianttype field
Parameters:
  type - The variant type to read
Parameters:
  codepage - The codepage to use to write non-wide strings A Java object that corresponds best to the variantfield. For example, a VT_I4 is returned as a Long, aVT_LPSTR as a String.
exception:
  ReadingNotSupportedException - if a property is to be writtenwho's variant type HPSF does not yet support
exception:
  UnsupportedEncodingException - if the specified codepage is notsupported.
See Also:   Variant



setLogUnsupportedTypes
public static void setLogUnsupportedTypes(boolean logUnsupportedTypes)(Code)

Specifies whether warnings about unsupported variant types are to be written to System.err or not.


Parameters:
  logUnsupportedTypes - If true warnings will be written,if false they won't.



write
public static int write(OutputStream out, long type, Object value, int codepage) throws IOException, WritingNotSupportedException(Code)

Writes a variant value to an output stream. This method ensures that always a multiple of 4 bytes is written.

If the codepage is UTF-16, which is encouraged, strings must always be written as Variant.VT_LPWSTR strings, not as Variant.VT_LPSTR strings. This method ensure this by converting strings appropriately, if needed.


Parameters:
  out - The stream to write the value to.
Parameters:
  type - The variant's type.
Parameters:
  value - The variant's value.
Parameters:
  codepage - The codepage to use to write non-wide strings The number of entities that have been written. In many cases an"entity" is a byte but this is not always the case.
exception:
  IOException - if an I/O exceptions occurs
exception:
  WritingNotSupportedException - if a property is to be writtenwho's variant type HPSF does not yet support



writeUnsupportedTypeMessage
protected static void writeUnsupportedTypeMessage(UnsupportedVariantTypeException ex)(Code)

Writes a warning to System.err that a variant type is unsupported by HPSF. Such a warning is written only once for each variant type. Log messages can be turned on or off by


Parameters:
  ex - The exception to log



Fields inherited from org.apache.poi.hpsf.Variant
final public static Integer LENGTH_0(Code)(Java Doc)
final public static Integer LENGTH_2(Code)(Java Doc)
final public static Integer LENGTH_4(Code)(Java Doc)
final public static Integer LENGTH_8(Code)(Java Doc)
final public static Integer LENGTH_UNKNOWN(Code)(Java Doc)
final public static Integer LENGTH_VARIABLE(Code)(Java Doc)
final public static int VT_ARRAY(Code)(Java Doc)
final public static int VT_BLOB(Code)(Java Doc)
final public static int VT_BLOB_OBJECT(Code)(Java Doc)
final public static int VT_BOOL(Code)(Java Doc)
final public static int VT_BSTR(Code)(Java Doc)
final public static int VT_BYREF(Code)(Java Doc)
final public static int VT_CARRAY(Code)(Java Doc)
final public static int VT_CF(Code)(Java Doc)
final public static int VT_CLSID(Code)(Java Doc)
final public static int VT_CY(Code)(Java Doc)
final public static int VT_DATE(Code)(Java Doc)
final public static int VT_DECIMAL(Code)(Java Doc)
final public static int VT_DISPATCH(Code)(Java Doc)
final public static int VT_EMPTY(Code)(Java Doc)
final public static int VT_ERROR(Code)(Java Doc)
final public static int VT_FILETIME(Code)(Java Doc)
final public static int VT_HRESULT(Code)(Java Doc)
final public static int VT_I1(Code)(Java Doc)
final public static int VT_I2(Code)(Java Doc)
final public static int VT_I4(Code)(Java Doc)
final public static int VT_I8(Code)(Java Doc)
final public static int VT_ILLEGAL(Code)(Java Doc)
final public static int VT_ILLEGALMASKED(Code)(Java Doc)
final public static int VT_INT(Code)(Java Doc)
final public static int VT_LPSTR(Code)(Java Doc)
final public static int VT_LPWSTR(Code)(Java Doc)
final public static int VT_NULL(Code)(Java Doc)
final public static int VT_PTR(Code)(Java Doc)
final public static int VT_R4(Code)(Java Doc)
final public static int VT_R8(Code)(Java Doc)
final public static int VT_RESERVED(Code)(Java Doc)
final public static int VT_SAFEARRAY(Code)(Java Doc)
final public static int VT_STORAGE(Code)(Java Doc)
final public static int VT_STORED_OBJECT(Code)(Java Doc)
final public static int VT_STREAM(Code)(Java Doc)
final public static int VT_STREAMED_OBJECT(Code)(Java Doc)
final public static int VT_TYPEMASK(Code)(Java Doc)
final public static int VT_UI1(Code)(Java Doc)
final public static int VT_UI2(Code)(Java Doc)
final public static int VT_UI4(Code)(Java Doc)
final public static int VT_UI8(Code)(Java Doc)
final public static int VT_UINT(Code)(Java Doc)
final public static int VT_UNKNOWN(Code)(Java Doc)
final public static int VT_USERDEFINED(Code)(Java Doc)
final public static int VT_VARIANT(Code)(Java Doc)
final public static int VT_VECTOR(Code)(Java Doc)
final public static int VT_VOID(Code)(Java Doc)

Methods inherited from org.apache.poi.hpsf.Variant
public static int getVariantLength(long variantType)(Code)(Java Doc)
public static String getVariantName(long variantType)(Code)(Java Doc)

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.