|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.starlink.table.StreamStarTableWriter | +--uk.ac.starlink.table.formats.HTMLTableWriter
A StarTableWriter that outputs text to HTML.
Depending on the value of the 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.
Constructor Summary | |
HTMLTableWriter()
Constructs a new writer with default characteristics. |
|
HTMLTableWriter(boolean standalone)
Constructs a new writer indicating whether it will produce complete or partial HTML documents. |
Method Summary | |
String |
getFormatName()
Gives the name of the format which is written by this writer. |
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. |
boolean |
looksLikeFile(String location)
Indicates whether the destination is of a familiar form for this kind of writer. |
protected void |
printFooter(OutputStream ostrm)
For standalone output, this method is invoked to output any text following the </TABLE> end tag. |
protected void |
printHeader(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,
OutputStream ostrm)
Writes a StarTable object to a given output stream. |
Methods inherited from class uk.ac.starlink.table.StreamStarTableWriter |
writeStarTable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HTMLTableWriter()
public HTMLTableWriter(boolean standalone)
Method Detail |
public void setStandalone(boolean standalone)
standalone
- true if the output document should be a
complete HTML documentpublic boolean isStandalone()
public String getFormatName()
StarTableWriter
public String getMimeType()
StarTableWriter
application/octet-stream
"
(for binary formats) or "text/plain
" for ASCII ones)
is recommended.
public boolean looksLikeFile(String location)
StarTableWriter
location
- the location name (probably filename)
public void writeStarTable(StarTable table, OutputStream ostrm) throws 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.
table
- the table to writeostrm
- the output stream to which startab should be
written
IOException
- if there is some I/O errorpublic static StarTableWriter[] getStarTableWriters()
protected void printHeader(OutputStream ostrm, StarTable table) throws IOException
ostrm
- output streamtable
- table for which header is required
IOException
protected void printFooter(OutputStream ostrm) throws IOException
ostrm
- output stream
IOException
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |