|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.starlink.table.StreamStarTableWriter
uk.ac.starlink.table.formats.HTMLTableWriter
public class 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 or 4.01,
depending on options.
| Constructor Summary | |
|---|---|
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. |
|
| 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. |
protected boolean |
isUrl(String txt)
Determines whether a string is apparently a URL. |
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 out)
Writes a StarTable object to a given output stream. |
void |
writeStarTables(TableSequence tableSeq,
OutputStream out)
Writes an array of StarTable objects to a given output stream. |
void |
writeStarTables(TableSequence tableSeq,
String location,
StarTableOutput sto)
Writes an array of StarTable objects to a given location. |
| 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 |
| Methods inherited from interface uk.ac.starlink.table.StarTableWriter |
|---|
writeStarTable |
| Constructor Detail |
|---|
public HTMLTableWriter()
public HTMLTableWriter(boolean standalone,
boolean useRowGroups)
| 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
getFormatName in interface StarTableWriterpublic String getMimeType()
StarTableWriterapplication/octet-stream"
(for binary formats) or "text/plain" for ASCII ones)
is recommended.
getMimeType in interface StarTableWriterpublic boolean looksLikeFile(String location)
StarTableWriter
looksLikeFile in interface StarTableWriterlocation - the location name (probably filename)
public void writeStarTable(StarTable table,
OutputStream out)
throws IOException
StarTableWriterBufferedOutputStream), 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 StarTableWritertable - the table to writeout - the output stream to which startab should be
written
TableFormatException - if this table cannot be written to a
stream
IOException - if there is some I/O error
public void writeStarTables(TableSequence tableSeq,
OutputStream out)
throws IOException
MultiStarTableWriterBufferedOutputStream), and should not close it at
the end of the call.
writeStarTables in interface MultiStarTableWritertableSeq - sequence of tables to writeout - destination stream
IOException
public void writeStarTables(TableSequence tableSeq,
String location,
StarTableOutput sto)
throws IOException
MultiStarTableWriter
writeStarTables in interface MultiStarTableWritertableSeq - sequence of tables to writelocation - destination for tablessto - StarTableOutput instance
IOExceptionpublic static StarTableWriter[] getStarTableWriters()
protected void printHeader(OutputStream ostrm,
StarTable table)
throws IOException
ostrm - output streamtable - table for which header is required; may be null
for multi-table output
IOException
protected void printFooter(OutputStream ostrm)
throws IOException
ostrm - output stream
IOExceptionprotected boolean isUrl(String txt)
txt - string to test
|
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 | ||||||||