public final class AttributeDefinition
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
immutable
Attribute is for read-only access
|
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 |
size
Attribute size
|
private int |
type
Attribute type.
|
Constructor and Description |
---|
AttributeDefinition(AttributeDefinition other)
Constructs an instance using other NodeAttribute as a template
|
AttributeDefinition(java.lang.String name,
int type,
boolean mandatory,
boolean multiple,
boolean immutable)
Constructs an instance of node attribute.
|
Modifier and Type | Method and Description |
---|---|
(package private) NodeAttribute |
genNodeAttribute()
Generate NodeAttribute from this definition.
|
java.lang.String |
getName()
Returns the value of name.
|
int |
getSize()
Returns exact size for fixed size attributes and 0 for unlimited size
strings.
|
int |
getType()
Returns the value of type.
|
boolean |
isCompatible(NodeAttribute definition)
Compare definition with given instance of
NodeAttribute
and decide if they are compatible by the means of name, type, etc. |
boolean |
isImmutable()
Returns
true if attribute is read only. |
boolean |
isMandatory()
Returns
true if attribute is mandatory. |
boolean |
isMultiple()
Returns
true if attribute can hold multiple values. |
private boolean immutable
private boolean mandatory
private boolean multiple
private java.lang.String name
private int size
private int type
AttributeDefinition(AttributeDefinition other)
other
- Source instance to copy from.AttributeDefinition(java.lang.String name, int type, boolean mandatory, boolean multiple, boolean immutable)
name
- Attribute name.type
- Attribute type (one of ATTR_* values).mandatory
- Is attribute mandatory?multiple
- Can attribute contain multiple values?immutable
- Can attribute be changed?public java.lang.String getName()
public int getSize()
public int getType()
public boolean isImmutable()
true
if attribute is read only.true
if attribute is read only.public boolean isMandatory()
true
if attribute is mandatory.public boolean isMultiple()
true
if attribute can hold multiple values.true
if attribute can hold multiple values.public boolean isCompatible(NodeAttribute definition)
NodeAttribute
and decide if they are compatible by the means of name, type, etc.definition
- Instance to compare with.true
if attribute definitions are compatible.NodeAttribute genNodeAttribute()