public class OOXMLAdapter extends Object implements OOXMLConstants
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
DEBUG |
borderStyle, builtInNames, cellFormulaType, cellType, chartDir, chartns, contentTypes, drawingDir, drawingmlns, drawingns, fontFamily, fontScheme, horizontalAlignment, legendPos, mediaDir, patternFill, pkgrelns, relns, relsContentTypes, systemColors, themeDir, threeDchartTypes, twoDchartTypes, typens, verticalAlignment, xmlHeader, xmlns| Constructor and Description |
|---|
OOXMLAdapter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDeferredFile(byte[] b,
String fn)
write a temp file for later inclusion in the zip file
|
protected File |
addDeferredFile(String name) |
protected void |
addDeferredFile(StringBuffer sb,
String fn)
write a temp file for later inclusion in the zip file
|
protected Stack |
cloneStack(Stack origStack)
creates a copy of a stack so changes won't affect original
|
static boolean |
deleteDir(File f) |
protected String |
getContentType(String type)
utility to look up Content Type string for type abbreviation
|
protected static ZipEntry |
getEntry(ZipFile f,
String name)
used as a way to monitor Zip Entry fetching
Oct 14, 2010
|
protected String |
getExOOXMLFileName(String f)
generic utility to take the original external object filename and parse it
using a new ordinal id e.g.
|
protected static String |
getFilename(ArrayList contentList,
String rId)
return the file matching rId in the ContentList (String[] type, filename,
rId)
|
int |
getFormat() |
static String |
getNextText(org.xmlpull.v1.XmlPullParser xpp)
utility to retrieve Text element for tag
|
protected String |
getRelationshipType(String type)
utility to look up Relationship Type string for type abbreviation
|
protected static String |
getRelationshipTypeAbbrev(String type)
utility to retrieve correct relationship type abbreviation string from
verbose type string
|
static String |
getStandaloneChartDrawingOOXML(ChartHandle ch)
get a standalone ChartML document
|
static String |
getTempDir(String f) |
static boolean |
hasMacros(Document bk)
return true of workbook bk contains macros
|
protected void |
nextZipEntry(String name) |
static boolean |
parseBoolean(String value)
Parses an xsd:boolean value.
|
protected static ArrayList |
parseRels(InputStream ii)
parses any .rels file into content List array list
|
static void |
refreshPassThroughFiles(WorkBookHandle wbh)
re-save to temp directroy any "pass-through" OOXML files i.e.
|
protected void |
reorderWbContentList(ArrayList wbContentList)
simple utility that ensures that sheets are last in the workbookcontent list
also ensure that theme(s) are parsed first, as are used in styles etc.
|
void |
setFormat(int format)
set the XLSX format for this WorkBook
either FORMAT_XLSX, FORMAT_XLSM (Macro-enabled), FORMAT_XLTS (template) or FORMAT_XLTM (Macro-enabled template) NOTE: If file extension is .XLSM format FORMAT_XLSM must be set either because there are macros present or because the filename is unconditionally set to .XLSM |
protected static void |
sortSheets(ArrayList cl)
sorts the sheets for incoming workbook xlsx -- used for eventMode only
Jan 19, 2011
|
static StringBuffer |
stripNonAscii(String s)
Strip non-ascii (i.e.
|
static StringBuffer |
stripNonAsciiRetainQuote(String s)
Strip non-ascii (i.e.
|
protected static InputStream |
wrapInputStream(InputStream in)
deal with the "BOM" input streams...
|
protected void |
writeFileToZIP(String f2write,
String fname)
utility which, given an an exisitng file f2write, creates zipEntry and writes
to zip var
NOTE: global zip ZipOutputStream must be open
|
static void |
writeSBToStreamEfficiently(StringBuffer aSB,
Writer ous)
A memory efficient way to write a StringBuffer to an OutputStream without
creating Strings and other Objects.
|
public void setFormat(int format)
format - public int getFormat()
public static final boolean parseBoolean(String value)
value - the string to parseIllegalArgumentException - if the given string is not a valid boolean valuepublic static String getStandaloneChartDrawingOOXML(ChartHandle ch)
ch - protected String getExOOXMLFileName(String f)
f - Original filename with pathprotected void addDeferredFile(StringBuffer sb, String fn)
sb - fn - public static void writeSBToStreamEfficiently(StringBuffer aSB, Writer ous) throws IOException
aSB - ous - IOExceptionprotected File addDeferredFile(String name) throws IOException
IOExceptionprotected void addDeferredFile(byte[] b,
String fn)
throws IOException
sb - fn - IOExceptionpublic static boolean hasMacros(Document bk)
bk - protected void writeFileToZIP(String f2write, String fname) throws IOException
f2write - name and path of exisitng filefname - desired name in zipIOExceptionprotected void nextZipEntry(String name) throws IOException
IOExceptionprotected String getContentType(String type)
type - protected String getRelationshipType(String type)
type - OOXMLConstnatsprotected static String getRelationshipTypeAbbrev(String type)
type - OOXMLConstantspublic static StringBuffer stripNonAscii(String s)
s - public static StringBuffer stripNonAsciiRetainQuote(String s)
s - protected static InputStream wrapInputStream(InputStream in)
in - protected static ZipEntry getEntry(ZipFile f, String name)
f - name - protected static ArrayList parseRels(InputStream ii)
ii - public static String getNextText(org.xmlpull.v1.XmlPullParser xpp) throws IOException, org.xmlpull.v1.XmlPullParserException
xpp - IOExceptionorg.xmlpull.v1.XmlPullParserExceptionprotected void reorderWbContentList(ArrayList wbContentList)
wbContentList - protected static String getFilename(ArrayList contentList, String rId)
contentList - rId - protected Stack cloneStack(Stack origStack)
origStack - public static boolean deleteDir(File f)
public static String getTempDir(String f) throws IOException
IOExceptionprotected static void sortSheets(ArrayList cl) throws Exception
cl - Exceptionpublic static void refreshPassThroughFiles(WorkBookHandle wbh)
wbh - Copyright © 2002–2019 Starter Inc.. All rights reserved.