public abstract class DocumentHandle extends Object implements Document, Handle, Closeable
| Modifier and Type | Field and Description |
|---|---|
protected int |
DEBUGLEVEL
The level of debugging output requested by the user.
|
protected File |
file
The file associated with this document.
|
static int |
FORMAT_NATIVE
Format constant for the most appropriate format for this document.
|
protected String |
name
The user-visible display name or title of this document.
|
static String |
workingdir |
DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM| Constructor and Description |
|---|
DocumentHandle()
default constructor
|
DocumentHandle(File input) |
DocumentHandle(InputStream urlx)
Apr 5, 2011
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(String name,
Object val)
Sets the value of a property in the workbook property store.
|
int |
getDebugLevel() |
File |
getFile()
Gets the file associated with this document.
|
abstract String |
getFileExtension()
Gets the file name extension for this document's native format.
|
protected static File |
getFileFromURL(URL u)
Deprecated.
The download should be handled outside OpenXLS.
There is no specific replacement for this method.
|
String |
getFileName()
Deprecated.
Use
getFile() instead. |
abstract int |
getFormat()
Gets the constant representing this document's native format.
|
static DocumentHandle |
getInstance(InputStream input)
Looks for magic numbers in the given input data and attempts to parse
it with an appropriate
DocumentHandle subclass. |
String |
getName()
Gets the user-visible descriptive name or title of this document.
|
Map<String,Object> |
getProperties()
Retrieves a Map containing the workbook properties store.
|
Object |
getProperty(String name)
Retrieves a property in the workbook property store.
|
static String |
getVersion()
Gets the OpenXLS version number.
|
abstract void |
reset()
Resets the document state to what it was when it was loaded.
|
void |
setDebugLevel(int level)
Sets the debugging output level.
|
void |
setFile(File file)
Sets the file associated with this document.
|
void |
setFileName(String name)
Deprecated.
Use
setFile(File) instead. |
void |
setName(String nm)
Sets the user-visible descriptive name or title of this document.
|
void |
setProperties(Map<String,Object> properties)
Replaces the workbook properties with the values in a given Map.
|
void |
setStreamingSheets(boolean streamSheets)
Handling for streaming sheets.
|
String |
toString()
Returns a string representation of the object.
|
void |
write(File file)
Writes the document to the given file in its native format.
|
void |
write(File file,
int format)
Writes the document to the given file in the requested format.
|
void |
write(OutputStream dest)
Writes the document to the given stream in its native format.
|
abstract void |
write(OutputStream dest,
int format)
Writes the document to the given stream in the requested format.
|
public static String workingdir
public static final int FORMAT_NATIVE
protected int DEBUGLEVEL
protected String name
protected File file
public DocumentHandle()
public DocumentHandle(InputStream urlx)
urlx - public DocumentHandle(File input)
public Object getProperty(String name)
getProperty in interface Documentname - the name of the property to retrievepublic void addProperty(String name, Object val)
addProperty in interface Documentname - the name of the property which should be updatedvalue - the value to which the property should be setpublic Map<String,Object> getProperties()
public void setProperties(Map<String,Object> properties)
properties - the values that will replace the existing propertiespublic static String getVersion()
public void setName(String nm)
public void setStreamingSheets(boolean streamSheets)
streamSheets - @Deprecated public void setFileName(String name)
setFile(File) instead.public void setFile(File file)
public File getFile()
null.public static DocumentHandle getInstance(InputStream input) throws IOException
DocumentHandle subclass. Detection
is performed on a best-effort basis and is not guaranteed to be accurate.IOException - if an error occurs while reading from the streamWorkBookException - if parsing fails@Deprecated public String getFileName()
getFile() instead.null.public void setDebugLevel(int level)
setDebugLevel in interface Documentpublic int getDebugLevel()
@Deprecated protected static File getFileFromURL(URL u)
u - the URL representing the resource to be downloadednull if an error occurredpublic String getName()
public abstract void reset()
reset in interface DocumentUnsupportedOperationException - if there is not sufficient data
available to perform the reversionpublic abstract int getFormat()
public abstract String getFileExtension()
public abstract void write(OutputStream dest, int format) throws IOException
write in interface Documentdest - the stream to which the document should be writtenformat - the constant representing the desired output formatIllegalArgumentException - if the given type code is invalidIOException - if an error occurs while writing to the streampublic void write(OutputStream dest) throws IOException
write in interface Documentdest - the stream to which the document should be writtenIOException - if an error occurs while writing to the streampublic void write(File file, int format) throws IOException
write in interface Documentfile - the path to which the document should be writtenformat - the constant representing the desired output formatIllegalArgumentException - if the given type code is invalidIOException - if an error occurs while writing to the filepublic void write(File file) throws IOException
write in interface Documentfile - the path to which the document should be writtenIOException - if an error occurs while writing to the streamCopyright © 2002–2019 Starter Inc.. All rights reserved.