Package org.dom4j.swing
Class XMLTableDefinition
- java.lang.Object
-
- org.dom4j.swing.XMLTableDefinition
-
- All Implemented Interfaces:
java.io.Serializable
,org.jaxen.VariableContext
public class XMLTableDefinition extends java.lang.Object implements java.io.Serializable, org.jaxen.VariableContext
XMLTableDefinition
represents a table definition based on XPath expression evaluated on an XML document.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XMLTableDefinition()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumn(java.lang.String name, java.lang.String expression)
void
addColumn(java.lang.String name, java.lang.String expression, int type)
void
addColumn(XMLTableColumnDefinition column)
void
addColumnWithXPathName(java.lang.String columnNameXPathExpression, java.lang.String expression, int type)
void
addNumberColumn(java.lang.String name, java.lang.String expression)
void
addStringColumn(java.lang.String name, java.lang.String expression)
void
clear()
protected void
clearCaches()
protected XPath
createColumnXPath(java.lang.String expression)
protected XPath
createXPath(java.lang.String expression)
XMLTableColumnDefinition
getColumn(int index)
XMLTableColumnDefinition
getColumn(java.lang.String columnName)
java.lang.Class<?>
getColumnClass(int columnIndex)
int
getColumnCount()
java.lang.String
getColumnName(int columnIndex)
DOCUMENT ME!XPath
getColumnNameXPath(int columnIndex)
DOCUMENT ME!XPath
getColumnXPath(int columnIndex)
DOCUMENT ME!XPath
getRowXPath()
Getter for property rowXPath.java.lang.Object
getValueAt(java.lang.Object row, int columnIndex)
java.lang.Object
getVariableValue(java.lang.String namespaceURI, java.lang.String prefix, java.lang.String localName)
protected void
handleException(java.lang.Exception e)
static XMLTableDefinition
load(Document definition)
Loads an XML table definition from an XML definition documentstatic XMLTableDefinition
load(Element definition)
Loads an XML table definition from an XML definition documentvoid
removeColumn(XMLTableColumnDefinition column)
void
setRowExpression(java.lang.String xpath)
void
setRowXPath(XPath rowXPath)
Setter for property rowXPath.
-
-
-
Method Detail
-
load
public static XMLTableDefinition load(Document definition)
Loads an XML table definition from an XML definition document- Parameters:
definition
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
load
public static XMLTableDefinition load(Element definition)
Loads an XML table definition from an XML definition document- Parameters:
definition
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getColumnClass
public java.lang.Class<?> getColumnClass(int columnIndex)
-
getColumnCount
public int getColumnCount()
-
getColumnName
public java.lang.String getColumnName(int columnIndex)
DOCUMENT ME!- Parameters:
columnIndex
- DOCUMENT ME!- Returns:
- the static column name. This is used if there is no columnNameXPath
-
getColumnXPath
public XPath getColumnXPath(int columnIndex)
DOCUMENT ME!- Parameters:
columnIndex
- DOCUMENT ME!- Returns:
- the XPath expression used to evaluate the value of cells in this column
-
getColumnNameXPath
public XPath getColumnNameXPath(int columnIndex)
DOCUMENT ME!- Parameters:
columnIndex
- DOCUMENT ME!- Returns:
- the XPath expresssion used to create the column name, if there is one or null if there is no XPath expression to name the column.
-
getValueAt
public java.lang.Object getValueAt(java.lang.Object row, int columnIndex)
-
addColumn
public void addColumn(java.lang.String name, java.lang.String expression)
-
addColumn
public void addColumn(java.lang.String name, java.lang.String expression, int type)
-
addColumnWithXPathName
public void addColumnWithXPathName(java.lang.String columnNameXPathExpression, java.lang.String expression, int type)
-
addStringColumn
public void addStringColumn(java.lang.String name, java.lang.String expression)
-
addNumberColumn
public void addNumberColumn(java.lang.String name, java.lang.String expression)
-
addColumn
public void addColumn(XMLTableColumnDefinition column)
-
removeColumn
public void removeColumn(XMLTableColumnDefinition column)
-
clear
public void clear()
-
getColumn
public XMLTableColumnDefinition getColumn(int index)
-
getColumn
public XMLTableColumnDefinition getColumn(java.lang.String columnName)
-
getRowXPath
public XPath getRowXPath()
Getter for property rowXPath.- Returns:
- Value of property rowXPath.
-
setRowXPath
public void setRowXPath(XPath rowXPath)
Setter for property rowXPath.- Parameters:
rowXPath
- New value of property rowXPath.
-
setRowExpression
public void setRowExpression(java.lang.String xpath)
-
getVariableValue
public java.lang.Object getVariableValue(java.lang.String namespaceURI, java.lang.String prefix, java.lang.String localName)
- Specified by:
getVariableValue
in interfaceorg.jaxen.VariableContext
-
createXPath
protected XPath createXPath(java.lang.String expression)
-
createColumnXPath
protected XPath createColumnXPath(java.lang.String expression)
-
clearCaches
protected void clearCaches()
-
handleException
protected void handleException(java.lang.Exception e)
-
-