RrdDefTemplate
, RrdGraphDefTemplate
public abstract class XmlTemplate
extends java.lang.Object
${variable_name}
.
Methods are provided to specify variable values at runtime.
Note that this class has limited functionality: XML source gets parsed, and variable
values are collected. You have to extend this class to do something more useful.修飾子とタイプ | フィールド | 説明 |
---|---|---|
protected org.w3c.dom.Element |
root |
修飾子 | コンストラクタ | 説明 |
---|---|---|
protected |
XmlTemplate(java.io.File xmlFile) |
|
protected |
XmlTemplate(java.lang.String xmlString) |
|
protected |
XmlTemplate(org.xml.sax.InputSource xmlSource) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
clearValues() |
Removes all placeholder-value mappings.
|
protected static org.w3c.dom.Node[] |
getChildNodes(org.w3c.dom.Node parentNode) |
|
protected static org.w3c.dom.Node[] |
getChildNodes(org.w3c.dom.Node parentNode,
java.lang.String childName) |
|
protected java.lang.String |
getChildValue(org.w3c.dom.Node parentNode,
java.lang.String childName) |
|
protected java.lang.String |
getChildValue(org.w3c.dom.Node parentNode,
java.lang.String childName,
boolean trim) |
|
protected boolean |
getChildValueAsBoolean(org.w3c.dom.Node parentNode,
java.lang.String childName) |
|
protected double |
getChildValueAsDouble(org.w3c.dom.Node parentNode,
java.lang.String childName) |
|
protected int |
getChildValueAsInt(org.w3c.dom.Node parentNode,
java.lang.String childName) |
|
protected long |
getChildValueAsLong(org.w3c.dom.Node parentNode,
java.lang.String childName) |
|
protected static org.w3c.dom.Node |
getFirstChildNode(org.w3c.dom.Node parentNode,
java.lang.String childName) |
|
protected java.lang.String |
getValue(org.w3c.dom.Node parentNode) |
|
protected java.lang.String |
getValue(org.w3c.dom.Node parentNode,
boolean trim) |
|
protected boolean |
getValueAsBoolean(org.w3c.dom.Node parentNode) |
|
protected java.awt.Paint |
getValueAsColor(org.w3c.dom.Node parentNode) |
|
protected double |
getValueAsDouble(org.w3c.dom.Node parentNode) |
|
protected int |
getValueAsInt(org.w3c.dom.Node parentNode) |
|
protected long |
getValueAsLong(org.w3c.dom.Node parentNode) |
|
java.lang.String[] |
getVariables() |
Returns the list of variables that should be set in this template.
|
protected boolean |
hasChildNode(org.w3c.dom.Node parentNode,
java.lang.String childName) |
|
boolean |
hasVariables() |
Searches the XML template to see if there are variables in there that
will need to be set.
|
protected boolean |
isEmptyNode(org.w3c.dom.Node node) |
|
void |
setVariable(java.lang.String name,
boolean value) |
Sets value for a single XML template variable.
|
void |
setVariable(java.lang.String name,
double value) |
Sets value for a single XML template variable.
|
void |
setVariable(java.lang.String name,
int value) |
Sets value for a single XML template variable.
|
void |
setVariable(java.lang.String name,
long value) |
Sets value for a single XML template variable.
|
void |
setVariable(java.lang.String name,
java.awt.Color value) |
Sets value for a single XML template variable.
|
void |
setVariable(java.lang.String name,
java.lang.String value) |
Sets value for a single XML template variable.
|
void |
setVariable(java.lang.String name,
java.util.Calendar value) |
Sets value for a single XML template variable.
|
void |
setVariable(java.lang.String name,
java.util.Date value) |
Sets value for a single XML template variable.
|
protected void |
validateTagsOnlyOnce(org.w3c.dom.Node parentNode,
java.lang.String[] allowedChildNames) |
protected XmlTemplate(org.xml.sax.InputSource xmlSource) throws java.io.IOException, RrdException
java.io.IOException
RrdException
protected XmlTemplate(java.lang.String xmlString) throws java.io.IOException, RrdException
java.io.IOException
RrdException
protected XmlTemplate(java.io.File xmlFile) throws java.io.IOException, RrdException
java.io.IOException
RrdException
public void clearValues()
public void setVariable(java.lang.String name, java.lang.String value)
${start}
, specify start
for the name
parameter.name
- variable namevalue
- value to be set in the XML templatepublic void setVariable(java.lang.String name, int value)
${start}
, specify start
for the name
parameter.name
- variable namevalue
- value to be set in the XML templatepublic void setVariable(java.lang.String name, long value)
${start}
, specify start
for the name
parameter.name
- variable namevalue
- value to be set in the XML templatepublic void setVariable(java.lang.String name, double value)
${start}
, specify start
for the name
parameter.name
- variable namevalue
- value to be set in the XML templatepublic void setVariable(java.lang.String name, java.awt.Color value)
${start}
, specify start
for the name
parameter.name
- variable namevalue
- value to be set in the XML templatepublic void setVariable(java.lang.String name, java.util.Date value)
${start}
, specify start
for the name
parameter.name
- variable namevalue
- value to be set in the XML templatepublic void setVariable(java.lang.String name, java.util.Calendar value)
${start}
, specify start
for the name
parameter.name
- variable namevalue
- value to be set in the XML templatepublic void setVariable(java.lang.String name, boolean value)
${start}
, specify start
for the name
parameter.name
- variable namevalue
- value to be set in the XML templatepublic boolean hasVariables()
public java.lang.String[] getVariables()
protected static org.w3c.dom.Node[] getChildNodes(org.w3c.dom.Node parentNode, java.lang.String childName)
protected static org.w3c.dom.Node[] getChildNodes(org.w3c.dom.Node parentNode)
protected static org.w3c.dom.Node getFirstChildNode(org.w3c.dom.Node parentNode, java.lang.String childName) throws RrdException
RrdException
protected boolean hasChildNode(org.w3c.dom.Node parentNode, java.lang.String childName)
protected java.lang.String getChildValue(org.w3c.dom.Node parentNode, java.lang.String childName) throws RrdException
RrdException
protected java.lang.String getChildValue(org.w3c.dom.Node parentNode, java.lang.String childName, boolean trim) throws RrdException
RrdException
protected java.lang.String getValue(org.w3c.dom.Node parentNode)
protected java.lang.String getValue(org.w3c.dom.Node parentNode, boolean trim)
protected int getChildValueAsInt(org.w3c.dom.Node parentNode, java.lang.String childName) throws RrdException
RrdException
protected int getValueAsInt(org.w3c.dom.Node parentNode)
protected long getChildValueAsLong(org.w3c.dom.Node parentNode, java.lang.String childName) throws RrdException
RrdException
protected long getValueAsLong(org.w3c.dom.Node parentNode)
protected double getChildValueAsDouble(org.w3c.dom.Node parentNode, java.lang.String childName) throws RrdException
RrdException
protected double getValueAsDouble(org.w3c.dom.Node parentNode)
protected boolean getChildValueAsBoolean(org.w3c.dom.Node parentNode, java.lang.String childName) throws RrdException
RrdException
protected boolean getValueAsBoolean(org.w3c.dom.Node parentNode)
protected java.awt.Paint getValueAsColor(org.w3c.dom.Node parentNode) throws RrdException
RrdException
protected boolean isEmptyNode(org.w3c.dom.Node node)
protected void validateTagsOnlyOnce(org.w3c.dom.Node parentNode, java.lang.String[] allowedChildNames) throws RrdException
RrdException