|
|||||||||
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 | |
---|---|
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. |
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 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
written
TableFormatException
- if this table cannot be written to a
stream
java.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 stream
java.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 instance
java.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 output
java.io.IOException
protected void printFooter(java.io.OutputStream ostrm) throws java.io.IOException
ostrm
- output stream
java.io.IOException
protected boolean isUrl(java.lang.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 |