public final class Structure extends Object
Modifier and Type | Field and Description |
---|---|
int |
attributeFieldCount
Number of fields available in array returned by
attributeFields . |
Field[] |
attributeFields
List of attribute fields of this structure.
|
Name[] |
attributeNames
List of attribute names in the element content.
|
int |
childNodeItemCount
Number of items available in array returned by
childNodeItems . |
Item[] |
childNodeItems
List of child node items of this structure.
|
static Field[] |
NO_FIELDS |
static Item[] |
NO_ITEMS |
static Name[] |
NO_NAMES |
Constructor and Description |
---|
Structure()
Constructs an empty structure.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeField(Name name,
Field field)
Appends an attribute field to the list of attribute fields.
|
void |
addChildNodeItem(Item item)
Appends an child node item to the list of child node items.
|
void |
addCommentItem()
Adds
CommentItem.INSTANCE to this structure. |
void |
addProcessingInstructionItem()
Adds
ProcessingInstructionItem.INSTANCE to this structure. |
void |
addTextItem()
Adds
TextItem.INSTANCE to this structure. |
void |
clear()
Removes all names, fields, items contained in this structure.
|
Structure |
copy()
Copies this structure.
|
public static final Name[] NO_NAMES
public static final Field[] NO_FIELDS
public static final Item[] NO_ITEMS
public Name[] attributeNames
This list is available because unlike child elements, attributes are
not ordered. Without this list, for example, there is no way to know to
which attribute corresponds first field returned by
attributeFields
.
This instance variable is read-only. Do not directly modify it..
public Field[] attributeFields
This instance variable is read-only. Do not directly modify it..
public int attributeFieldCount
attributeFields
.
This instance variable is read-only. Do not directly modify it..
public Item[] childNodeItems
This instance variable is read-only. Do not directly modify it..
public int childNodeItemCount
childNodeItems
.
This instance variable is read-only. Do not directly modify it..
public void addAttributeField(Name name, Field field)
The fact that this attribute is already contained in this structure is not checked.
public void addChildNodeItem(Item item)
public void addTextItem()
TextItem.INSTANCE
to this structure.
This is a convenience method.
public void addCommentItem()
CommentItem.INSTANCE
to this structure.
This is a convenience method.
public void addProcessingInstructionItem()
ProcessingInstructionItem.INSTANCE
to this structure.
This is a convenience method.
public void clear()
public Structure copy()
attributeFields.length == attributeFieldCount
and
childNodeItems.length == childNodeItemCount