MultiStarTableWriter
, StarTableWriter
public class HTMLTableWriter extends StreamStarTableWriter implements MultiStarTableWriter
standalone
attribute,
the output may either be a complete HTML document or just a
<TABLE> element suitable for inserting into an existing document.
The output HTML is intended to conform to HTML 3.2 or 4.01,
depending on options.Constructor | Description |
---|---|
HTMLTableWriter() |
Constructs a new writer with default characteristics.
|
HTMLTableWriter(boolean standalone,
boolean useRowGroups) |
Constructs a new writer indicating whether it will produce complete
or partial HTML documents.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getFormatName() |
Gives the name of the format which is written by this writer.
|
java.lang.String |
getMimeType() |
Returns a string suitable for use as the value of a MIME
Content-Type header.
|
static StarTableWriter[] |
getStarTableWriters() |
Returns a selection of useful HTMLTableWriters.
|
boolean |
isStandalone() |
Indicates whether output tables will be complete HTML documents.
|
protected boolean |
isUrl(java.lang.String txt) |
Determines whether a string is apparently a URL.
|
boolean |
looksLikeFile(java.lang.String location) |
Indicates whether the destination is of a familiar form for this
kind of writer.
|
protected void |
printFooter(java.io.OutputStream ostrm) |
For standalone output, this method is invoked to output any text
following the </TABLE> end tag.
|
protected void |
printHeader(java.io.OutputStream ostrm,
StarTable table) |
For standalone output, this method is invoked to output any text
preceding the <TABLE> start tag.
|
void |
setStandalone(boolean standalone) |
Sets whether output tables should be complete HTML documents.
|
void |
writeStarTable(StarTable table,
java.io.OutputStream out) |
Writes a StarTable object to a given output stream.
|
void |
writeStarTables(TableSequence tableSeq,
java.io.OutputStream out) |
Writes an array of StarTable objects to a given output stream.
|
void |
writeStarTables(TableSequence tableSeq,
java.lang.String location,
StarTableOutput sto) |
Writes an array of StarTable objects to a given location.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeStarTable
writeStarTable
public HTMLTableWriter()
public HTMLTableWriter(boolean standalone, boolean useRowGroups)
public void setStandalone(boolean standalone)
standalone
- true if the output document should be a
complete HTML documentpublic boolean isStandalone()
public java.lang.String getFormatName()
StarTableWriter
getFormatName
in interface StarTableWriter
public java.lang.String getMimeType()
StarTableWriter
application/octet-stream
"
(for binary formats) or "text/plain
" for ASCII ones)
is recommended.getMimeType
in interface StarTableWriter
public boolean looksLikeFile(java.lang.String location)
StarTableWriter
looksLikeFile
in interface StarTableWriter
location
- the location name (probably filename)public void writeStarTable(StarTable table, java.io.OutputStream out) throws java.io.IOException
StarTableWriter
BufferedOutputStream
), and should not close it
at the end of the call.
Not all table writers are capable of writing to a stream;
an implementation may throw a TableFormatException
to
indicate that it cannot do so.
writeStarTable
in interface StarTableWriter
table
- the table to writeout
- the output stream to which startab should be
writtenTableFormatException
- if this table cannot be written to a
streamjava.io.IOException
- if there is some I/O errorpublic void writeStarTables(TableSequence tableSeq, java.io.OutputStream out) throws java.io.IOException
MultiStarTableWriter
BufferedOutputStream
), and should not close it at
the end of the call.writeStarTables
in interface MultiStarTableWriter
tableSeq
- sequence of tables to writeout
- destination streamjava.io.IOException
public void writeStarTables(TableSequence tableSeq, java.lang.String location, StarTableOutput sto) throws java.io.IOException
MultiStarTableWriter
writeStarTables
in interface MultiStarTableWriter
tableSeq
- sequence of tables to writelocation
- destination for tablessto
- StarTableOutput instancejava.io.IOException
public static StarTableWriter[] getStarTableWriters()
protected void printHeader(java.io.OutputStream ostrm, StarTable table) throws java.io.IOException
ostrm
- output streamtable
- table for which header is required; may be null
for multi-table outputjava.io.IOException
protected void printFooter(java.io.OutputStream ostrm) throws java.io.IOException
ostrm
- output streamjava.io.IOException
protected boolean isUrl(java.lang.String txt)
txt
- string to testCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.