|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sas.Component | +--com.sas.servlet.beans.BaseTransformation | +--com.sas.servlet.beans.BaseTable
Transformation bean base object for creating 2-dimensional table.
The Table Transformation Bean requires a model that implements
com.sas.table.StaticTableInterface. If the model implements other
interfaces they will be utilized as well:
Template are used to specify either the column formats for a row, or the template for the entire row. Column heading templates can also be supplied. Each template can embed column data using special markers (such as ## for the data from the current column, #<column name># for the data from a given column name, or #<column number># for the data from a given 1-based column index. Special meta data tags can also be used to retrieve information about the underlying table
Valid meta data tags are:
For example, a simple 2-D table with no special formatting may set the columnFormat as:
Field Summary | |
static String |
MARKER
|
static String |
MARKER_ESC
|
static String |
MARKER_META
|
static String |
MARKER_META_ROWID
|
Constructor Summary | |
BaseTable()
|
Method Summary | |
protected String |
formatRow(long rowNumber,
String format)
Replaces the markers (column names, index values, and meta data) with data from the model. |
String |
getBeginRowFormat()
Gets the format to begin a new table row |
int |
getBorderWidth()
Gets the width of the outer border around the table. |
protected String |
getCell(StaticTableInterface model,
long row,
int cell)
Returns the string representation of the given cell from the current row in the table. |
int |
getCellPadding()
Gets the number of pixels between the border of a cell and the cell's contents. |
int |
getCellSpacing()
Gets the number of pixels between the border of each cell. |
protected int |
getColumnCount(StaticTableInterface model)
Gets the number of columns in the current table |
String |
getColumnFormat()
Gets the format to be applied to each data element in a row. |
String |
getColumnFormat(int index)
Gets the format to be applied to a single data element in a row. |
String |
getColumnFormat(int columnIndex,
long rowIndex)
Gets the format to be applied to a single data element in the given row. |
protected String |
getColumnFormat(String format,
int index)
Replaces the default markers (those without a column name or index) with the given column index |
String |
getColumnHeadingColumnFormat()
Gets the format to be applied to each column heading column |
String |
getColumnHeadingColumnFormat(int index)
Gets the format to be applied to a single column heading column. |
String |
getColumnHeadingFormat()
Gets the format for the column heading row. |
protected int |
getColumnIndex(StaticTableInterface model,
String name)
Returns the column index for the given column name |
protected int |
getColumnIndex(String s)
Determine if the given string is a column index. |
protected Object |
getColumnInfo(StaticTableInterface model,
int col,
String columnInfoName)
Returns the column info for the given column |
String |
getEndRowFormat()
Gets the format to end table row |
long |
getMaxRows()
Gets the maximum number of rows to be formatted when writing a table. |
Vector |
getRequiredInterfaces()
Sets the required interface that a model must implement in order to attach to this bean. |
String |
getRowFormat()
Gets the format for each row in the table. |
String |
getRowFormat(long index)
Gets the format for the given row in the table. |
boolean |
getUseColumnHeadings()
Returns true if column headings should be written. |
int |
getWidth()
Gets the width of the table in pixels. |
int |
getWidthPercentage()
Gets the width of the table as a percentage |
protected boolean |
hasRepeatingFormats()
Determines if there are any repeating formats specified (either column or row) |
boolean |
isLastWriteTruncated()
Determines if the last writing of a table exceeded the maximum number of rows. |
protected boolean |
isMetaTag(String tag)
Determines if the given tag is a META tag |
protected boolean |
rowExists(StaticTableInterface model,
long rowNumber)
Determines if the given row exists |
void |
setBeginRowFormat(String format)
Sets the format to begin a new table row |
void |
setBorderWidth(int border)
Sets the width of the outer border around the table in pixels. |
void |
setCellPadding(int padding)
Sets the number of pixels between the border of a cell and the cell's contents. |
void |
setCellSpacing(int spacing)
Sets the number of pixels between the border of each cell. |
void |
setColumnFormat(String format)
Sets the format to be applied to each data element in a row. |
void |
setColumnFormat(String format,
int index)
Sets the format to be applied to an individual data element in a row. |
void |
setColumnFormat(String format,
int index,
int repeatColumn)
Sets the format to be applied to an individual data element in a row. |
void |
setColumnFormat(String format,
int index,
int repeatColumn,
long startingRow,
int repeatRow)
Sets the format to be applied to an individual data element in the given row. |
void |
setColumnFormat(String format,
int index,
long startingRow,
int repeatRow)
Sets the format to be applied to an individual data element in the given row. |
void |
setColumnHeadingColumnFormat(String format)
Sets the format to be applied to each column heading column. |
void |
setColumnHeadingColumnFormat(String format,
int index)
Sets the format to be applied to a single column heading column. |
void |
setColumnHeadingFormat(String format)
Sets the format for the column heading row. |
void |
setEndRowFormat(String format)
Sets the format to end a table row |
void |
setMaxRows(long n)
Sets the maximum number of rows to be formatted when writing a table. |
void |
setModelInterface(ModelInterface newValue)
Specifies the model to display in the view. |
void |
setRowFormat(String format)
Sets the format for each row in the table. |
void |
setRowFormat(String format,
long startingRow,
int repeatRow)
Sets the format for a given 1-based row number in the table. |
void |
setUseColumnHeadings(boolean enable)
Turns on/off the use of column headings. |
void |
setWidth(int pixels)
Sets the width of the table in pixels. |
void |
setWidthPercentage(int width)
Sets the width of the table as a percentage |
void |
write(PrintWriter out)
Writes the transformed representation of the object |
void |
writeColumnHeadings(OutputStream out)
Writes the column headings |
void |
writeColumnHeadings(PrintWriter out)
Writes the column headings |
void |
writeColumnHeadings(Writer out)
Writes the column headings |
void |
writeRow(long row,
OutputStream out)
Writes a single row of the formatted table. |
void |
writeRow(long rowNumber,
PrintWriter out)
Writes a single row of the formatted table. |
void |
writeRow(long row,
Writer out)
Writes a single row of the formatted table. |
protected void |
writeTable(PrintWriter out)
Formats and writes the contents of the entire table |
void |
writeTableFooter(OutputStream out)
Writes the table footer |
void |
writeTableFooter(Writer out)
Writes the table footer |
void |
writeTableHeader(OutputStream out)
Writes the table header |
void |
writeTableHeader(Writer out)
Writes the table header |
Methods inherited from class com.sas.servlet.beans.BaseTransformation |
getCustomAttributes,
getDescription,
getName,
getParent,
getRequest,
getResponse,
setCustomAttributes,
setDescription,
setName,
setParent,
setRequest,
setResponse,
toString,
write,
write,
write |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final String MARKER
public static final String MARKER_ESC
public static final String MARKER_META
public static final String MARKER_META_ROWID
Constructor Detail |
public BaseTable()
Method Detail |
public Vector getRequiredInterfaces()
public void setModelInterface(ModelInterface newValue)
null
to disassociate the view from its model.newValue
- The new value to assign the modelInterface property.public void setMaxRows(long n)
max
- The maximum number of rowspublic long getMaxRows()
public boolean isLastWriteTruncated()
public void setRowFormat(String format)
format
- The format stringpublic String getRowFormat()
public void setRowFormat(String format, long startingRow, int repeatRow)
format
- The format string, or null to remove the formatstartingRow
- The 1-based row number that will first use the formatrepeatRow
- The number of rows until the format is repeated, or -1
for no repeating.public String getRowFormat(long index)
index
- The 1-based row indexpublic void setBeginRowFormat(String format)
The
- format stringpublic String getBeginRowFormat()
public void setColumnFormat(String format)
format
- The format string to be applied to each data elementpublic void setColumnFormat(String format, int index)
format
- The format string to be applied to a single data element, or
null to remove the formatindex
- The 1-based column index, or -1 for all columnspublic void setColumnFormat(String format, int index, int repeatColumn)
format
- The format string to be applied to a single data element,
or null to remove the formatindex
- The 1-based column index that will first use the formatrepeatColumn
- The number of columns until the format is repeated,
or -1 for no repeatingpublic void setColumnFormat(String format, int index, long startingRow, int repeatRow)
format
- The format string to be applied to a single data element,
or null to remove the formatindex
- The 1-based column index or -1 for all columnsstartingRow
- The 1-based row number that will first use the formatrepeatRow
- The number of rows until the format is repeated, or -1public void setColumnFormat(String format, int index, int repeatColumn, long startingRow, int repeatRow)
format
- The format string to be applied to a single data element,
or null to remove the formatindex
- The 1-based column index or -1 for all columnsrepeatColumn
- The number of columns until the format is repeated,
or -1 for no repeatingstartingRow
- The 1-based row number that will first use the formatrepeatRow
- The number of rows until the format is repeated, or -1
for no repeatingpublic String getColumnFormat(int index)
index
- The 1-based column indexpublic String getColumnFormat(int columnIndex, long rowIndex)
columnIndex
- The 1-based column indexrowIndex
- The 1-based row indexpublic String getColumnFormat()
public void setEndRowFormat(String format)
The
- format stringpublic String getEndRowFormat()
public void write(PrintWriter out) throws IOException
out
- The output streamprotected void writeTable(PrintWriter out) throws IOException
out
- The output streamprotected boolean hasRepeatingFormats()
protected boolean rowExists(StaticTableInterface model, long rowNumber)
rowNumber
- The 1-based row to checkpublic void writeRow(long rowNumber, PrintWriter out) throws IOException
row
- The 1-based row number to writeout
- The output streamprotected int getColumnCount(StaticTableInterface model) throws IOException
model
- The table modelpublic void writeColumnHeadings(PrintWriter out) throws IOException
out
- The output streamprotected String getColumnFormat(String format, int index)
format
- The data formatindex
- The 1-based column indexprotected String formatRow(long rowNumber, String format) throws IOException
row
- The 1-based row number to writeformat
- The data formatprotected Object getColumnInfo(StaticTableInterface model, int col, String columnInfoName) throws IOException
model
- The table modelcolumn
- The 1-based column numbercolumnInfoName
- The info to gatherprotected int getColumnIndex(StaticTableInterface model, String name) throws IOException
model
- The table modelname
- The column nameprotected String getCell(StaticTableInterface model, long row, int cell) throws IOException
model
- The table modelrow
- The 1-based row numbercell
- The 1-based cell numberprotected boolean isMetaTag(String tag)
protected int getColumnIndex(String s)
public void writeRow(long row, Writer out) throws IOException
row
- The 1-based row number to writeout
- The output streampublic void writeRow(long row, OutputStream out) throws IOException
row
- The 1-based row number to writeout
- The output streampublic void writeColumnHeadings(Writer out) throws IOException
out
- The output streampublic void writeColumnHeadings(OutputStream out) throws IOException
out
- The output streampublic void writeTableHeader(Writer out) throws IOException
out
- The output streampublic void writeTableHeader(OutputStream out) throws IOException
out
- The output streampublic void writeTableFooter(Writer out) throws IOException
out
- The output streampublic void writeTableFooter(OutputStream out) throws IOException
out
- The output streampublic void setWidth(int pixels)
width
- The width in pixelspublic int getWidth()
public void setWidthPercentage(int width)
width
- The width as a percentagepublic int getWidthPercentage()
public void setBorderWidth(int border)
border
- The border width in pixelspublic int getBorderWidth()
public void setCellSpacing(int spacing)
spacing
- The number of pixels between each cellpublic int getCellSpacing()
public void setCellPadding(int padding)
padding
- The number of pixels between the cell border and the cell
contentpublic int getCellPadding()
public void setColumnHeadingColumnFormat(String format)
The
- column heading column formatpublic void setColumnHeadingColumnFormat(String format, int index)
The
- column heading column format to be applied to a single column,
or null to remove the formatindex
- The 1-based column indexpublic String getColumnHeadingColumnFormat(int index)
index
- The 1-based column indexpublic String getColumnHeadingColumnFormat()
public void setColumnHeadingFormat(String format)
The
- column heading formatpublic String getColumnHeadingFormat()
public void setUseColumnHeadings(boolean enable)
enable
- true if headings should be writtenpublic boolean getUseColumnHeadings()
true
- if headings should be written
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |