public final class NodeAttribute
extends java.lang.Object
implements java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
private int |
count
Number of the values assigned to the attribute.
|
private boolean |
mandatory
Is attribute mandatory for the node or not
|
private boolean |
multiple
Can attribute contain multiple values or not
|
private java.lang.String |
name
Attribute name.
|
private int |
type
Attribute type.
|
Constructor and Description |
---|
NodeAttribute()
Default constructor
|
NodeAttribute(NodeAttribute other)
Constructs an instance using other NodeAttribute as a template
|
NodeAttribute(java.lang.String name,
int type,
boolean mandatory,
boolean multiple,
int count)
Constructs an instance of node attribute.
|
Modifier and Type | Method and Description |
---|---|
int |
getCount()
Returns number of values assigned to the attribute.
|
java.lang.String |
getName()
Returns the value of name.
|
int |
getType()
Returns the value of type.
|
boolean |
isMandatory()
Returns
true if attribute is mandatory. |
boolean |
isMultiple()
Returns
true if attribute can contain multiple values. |
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
(package private) void |
setCount(int count)
Update value counter.
|
java.lang.String |
toString()
Present
NodeAttribute information in user readable form. |
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
private int count
private boolean mandatory
private boolean multiple
private java.lang.String name
private int type
public NodeAttribute()
NodeAttribute(NodeAttribute other)
other
- Source instance to copy from.NodeAttribute(java.lang.String name, int type, boolean mandatory, boolean multiple, int count)
name
- Attribute name.type
- attribute type (one of ATTR_* values).mandatory
- Is attribute mandatory?multiple
- Is attribute contains multiple values?count
- Number of values assigned to the attribute.public int getCount()
public java.lang.String getName()
public int getType()
public boolean isMandatory()
true
if attribute is mandatory.true
if attribute is mandatory.public boolean isMultiple()
true
if attribute can contain multiple values.true
if attribute can contain multiple values.public java.lang.String toString()
NodeAttribute
information in user readable form.toString
in class java.lang.Object
NodeAttribute
data as human-readable
String
.Object.toString()
void setCount(int count)
count
- New number of values assigned to the attribute.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which fields will be saved.java.io.IOException
- In case of I/O errors.public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- Input source from which fields will be restored.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If payload can't be instantiated.