public interface Field extends Item
An attribute field is an attribute Name + a handle for an AttributeType.
The attribute type can be obtained using ElementType.getAttributeType(com.xmlmind.xml.validate.Field, com.xmlmind.xml.name.Name)
.
An child element field is a child element Name + a handle for an
ElementType. The element type can be obtained using ElementType.getChildElementType(com.xmlmind.xml.validate.Field, com.xmlmind.xml.name.Name)
.
Note that a field cannot be uniquely identified by its name or name
class. For example, ElementType.getChildElementFields()
can return
several fields with same name but with different child element types.
For the following element, ElementType.getStructure(com.xmlmind.xml.doc.Attribute[], int, com.xmlmind.xml.doc.Node[], int, boolean, com.xmlmind.xml.validate.Structure)
returns 3
child element fields called div, but the first 2 divs
have different content types, therefore the 2 first fields are different.
(The last 2 fields are the same object, that is, ==
returns
true
when comparing them.)
<flow> <div role="header"> ... </div> <div role="block"> ... </div> <div role="block"> ... </div> </flow>
Modifier and Type | Method and Description |
---|---|
String |
getFieldLabel(boolean isAttribute,
NamespaceToPrefixes nsToPrefixes)
Returns a label for this field that can be used in a GUI.
|
Name |
getFieldName()
Returns field name.
|
NameClass |
getFieldNameClass()
Returns set of names of this wildcard field.
|
Name getFieldName()
null
if this field is a
wildcard.NameClass getFieldNameClass()
null
if this field is not a wildcard.String getFieldLabel(boolean isAttribute, NamespaceToPrefixes nsToPrefixes)
isAttribute
- true
if this field is an attribute
field; false
if this field is a child element fieldnsToPrefixes
- may be used to create the label