public class CounterDescriptionModel extends Object implements XMLMarshallable
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="counterDescription">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="initialValue" type="xs:decimal"/>
<xs:attribute name="counterName" type="xs:string"/>
<xs:attribute name="isTransient" type="xs:boolean" use="optional" default="false"/>
</xs:complexType>
</xs:element>
| Modifier and Type | Field and Description |
|---|---|
static String |
TAG_NAME
The value of that constant is the XML tag name of the counter description.
|
| Constructor and Description |
|---|
CounterDescriptionModel()
Constructs an empty counter model.
|
CounterDescriptionModel(String name,
String description,
BigDecimal initialValue)
Constructs a counter without the mapped counter name.
|
CounterDescriptionModel(String name,
String description,
BigDecimal initialValue,
boolean isTransient)
Constructs a counter without the mapped counter name.
|
CounterDescriptionModel(String name,
String description,
BigDecimal initialValue,
String counterName)
Constructs a full counter.
|
CounterDescriptionModel(String name,
String description,
BigDecimal initialValue,
String counterName,
boolean isTransient)
Constructs a full counter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String name,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
boolean |
checkValidity()
Returns true if the counter is valid.
|
String |
getCounterName()
Returns the mapped counter name.
|
String |
getDescription()
Returns the description of the counter.
|
BigDecimal |
getInitialValue()
Returns the initial value of the counter.
|
String |
getName()
Returns the name of the counter.
|
boolean |
isTransient()
Checks if counter is transient.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setCounterName(String counterName)
Sets the mapped counter name.
|
void |
setDescription(String description)
Sets the description of the counter.
|
void |
setInitialValue(BigDecimal initialValue)
Sets the initial value of the counter.
|
void |
setName(String name)
Sets the name of the counter.
|
void |
setTransient()
Sets counter transient.
|
String |
validate(Vector<CounterDescriptionModel> sharedCounters,
boolean link)
Checks if this counter description is valid.
|
public static final String TAG_NAME
public CounterDescriptionModel()
public CounterDescriptionModel(String name, String description, BigDecimal initialValue)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.public CounterDescriptionModel(String name, String description, BigDecimal initialValue, boolean isTransient)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.isTransient - counter is transient if true, persistent otherwisepublic CounterDescriptionModel(String name, String description, BigDecimal initialValue, String counterName)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.counterName - the name of the mapped counter.public CounterDescriptionModel(String name, String description, BigDecimal initialValue, String counterName, boolean isTransient)
name - the name of the counter.description - the description of the counter.initialValue - the initial value of the counter.counterName - the name of the mapped counter.isTransient - counter is transient if true, persistent otherwisepublic String getName()
public void setName(String name)
name - the name of the counter.public void setDescription(String description)
description - the description of the counter.getDescription()public String getDescription()
setDescription(String)public BigDecimal getInitialValue()
public void setInitialValue(BigDecimal initialValue)
initialValue - the initial value of the counter.public String getCounterName()
public void setCounterName(String counterName)
counterName - the name of the mapped counter.public boolean isTransient()
public void setTransient()
public boolean checkValidity()
public String validate(Vector<CounterDescriptionModel> sharedCounters, boolean link)
sharedCounters - a list of CounterDescriptionModel that represents
the available shared counters.link - true if the counter described by this counter description maps a shared counters, false otherwise.public void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(String name, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallablename - The name of tag for the childchild - The child to be addedpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into