com.extentech.ExtenXLS
Class DocumentHandle

java.lang.Object
  extended by com.extentech.ExtenXLS.DocumentHandle
All Implemented Interfaces:
Handle
Direct Known Subclasses:
com.extentech.ExtenDOC.DocHandle, WorkBookHandle

public class DocumentHandle
extends Object
implements Handle

This is the Abstract document class which represents an atomic Document file or object.

Author:
John McMahon :: Jan 26, 2010 :: Copyright ©2010 Extentech Inc.

Constructor Summary
DocumentHandle()
          default empty constructor
DocumentHandle(File input)
          May 19, 2010
DocumentHandle(String file)
          defualt constructor takes a .doc file
 
Method Summary
 void addProperty(String name, Object val)
          Sets the value of a property in the workbook property store.
 void close()
          Closes the WorkBook and releases resources.
 void finalize()
          Closes the WorkBook and releases resources.
 byte[] getBytes()
          Deprecated.  
 com.extentech.formats.DOC.DocumentFactory getFactory()
          returns a low-level DocumentFactory NOTE: The WorkBook class is NOT a part of the published API.
 String getName()
          Returns the name of this WorkBook
 Map getProperties()
          Retrieves a Map containing the workbook properties store.
 Object getProperty(String name)
          Retrieves the a property in the workbook property store.
static String getVersion()
          Return the version of ExtenXLS
 String getWorkingDirectory()
          Returns the directory containing the ExtenXLS.jar and extenxls.lic files.
 void reset()
          Resets the values of this WorkBookHandle to defaults.
 void setDebugLevel(int l)
          Set the Debugging level.
 void setName(String nm)
          Sets the internal name of this WorkBookHandle.
 void setProperties(Map properties)
          Replaces the workbook properties store with the given Map.
 String toString()
          Returns the name of this Sheet.
 void write(OutputStream out)
          Saves the WorkBookHandle to this opened OutputStream If original file is Excel2007 Format, the template will be written in Excel 2007 (XLSX) Format.
 void write(String fname)
          Saves this WorkBookHandle to filename and path fname if the filename ends with ".xlsx" or ".xlsm", the template will be written in Excel 2007 (XLSX) Format.
 void write(String fname, boolean Excel2007Format)
          saves this WorkBookHandle to filename and path fname if Excel2007 Format, the template will be written in Excel 2007 (XLSX) Format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentHandle

public DocumentHandle()
default empty constructor


DocumentHandle

public DocumentHandle(String file)
defualt constructor takes a .doc file

Parameters:
file -

DocumentHandle

public DocumentHandle(File input)
May 19, 2010

Parameters:
input -
Method Detail

getProperty

public Object getProperty(String name)
Retrieves the a property in the workbook property store. This is not an Excel-compatible feature.

Parameters:
name - the name of the property to retrieve
Returns:
the value of the requested property or null if it doesn't exist

addProperty

public void addProperty(String name,
                        Object val)
Sets the value of a property in the workbook property store. This is not an Excel-compatible feature.

Parameters:
name - the name of the property which should be updated
value - the value to which the property should be set

getProperties

public Map getProperties()
Retrieves a Map containing the workbook properties store. This is not an Excel-compatible feature.


setProperties

public void setProperties(Map properties)
Replaces the workbook properties store with the given Map. This is not an Excel-compatible feature.

Parameters:
properties - a Map which will be used as the properties store

close

public void close()
Closes the WorkBook and releases resources.

See Also:
Object.finalize()

finalize

public void finalize()
Closes the WorkBook and releases resources.

Overrides:
finalize in class Object
See Also:
Object.finalize()

getVersion

public static String getVersion()
Return the version of ExtenXLS

Returns:
String version of ExtenXLS

setName

public void setName(String nm)
Sets the internal name of this WorkBookHandle. Overrides the default for 'getName()' which returns the file name source of this WorkBook by default.

Parameters:
WorkBook - Name

setDebugLevel

public void setDebugLevel(int l)
Set the Debugging level. Higher values output more debugging info during execution.


getBytes

public byte[] getBytes()
Deprecated. 

Create a byte array containing the binary Document bytes Outputs a Excel 97-2003 (BIFF8) compatible Document This method creates a potentially large byte array and is not suitable for use with large output due to memory usage. Please use writeBytes() with an appropriate OutputStream for best memory performance.

See Also:
WorkBook.getBytes()

write

public void write(String fname)
Saves this WorkBookHandle to filename and path fname if the filename ends with ".xlsx" or ".xlsm", the template will be written in Excel 2007 (XLSX) Format. Otherwise, it will be written in Excel 2003 Format. NOTE: for Excel2007 Format, if the file has an OOXML vba project, the file extension must be ".xlsm". It will be changed from ".xlsx" if necessary.

Parameters:
fname -

write

public void write(String fname,
                  boolean Excel2007Format)
saves this WorkBookHandle to filename and path fname if Excel2007 Format, the template will be written in Excel 2007 (XLSX) Format. Otherwise, it will be written in Excel 2003 Format. NOTE: for Excel2007Format, if the file has an OOXML vba project, the file extension must be ".xlsm". It will be changed from ".xlsx" if necessary.

Parameters:
fname -
Excel2007Format -

write

public void write(OutputStream out)
Saves the WorkBookHandle to this opened OutputStream If original file is Excel2007 Format, the template will be written in Excel 2007 (XLSX) Format. Otherwise, it will be written in Excel 2003 Format.

Parameters:
out -

getWorkingDirectory

public String getWorkingDirectory()
Returns the directory containing the ExtenXLS.jar and extenxls.lic files. This must be called BEFORE using the byte Array WorkBookHandle constructor.

Returns:
String directory path containing ExtenXLS.jar and extenxls.lic

getName

public String getName()
Returns the name of this WorkBook

Returns:
String name of WorkBook

getFactory

public com.extentech.formats.DOC.DocumentFactory getFactory()
returns a low-level DocumentFactory NOTE: The WorkBook class is NOT a part of the published API. Any of the methods and/or variables on a WorkBook object are subject to change without notice in new versions of ExtenXLS.

Returns:
DocumentFactory - the factory for this WorkBook

reset

public void reset()
Resets the values of this WorkBookHandle to defaults.


toString

public String toString()
Returns the name of this Sheet.

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2010 Extentech Inc. All Rights Reserved.