public class PropertyDescriptionModel extends Object implements XMLMarshallable
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="prop">
<xs:complexType>
<xs:sequence>
<xs:element ref="additionalInformation" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="PropertyDescType" default="string"/>
<xs:attribute name="description" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="PropertyDescType">
<xs:restriction base="xs:string">
<xs:enumeration value="number"/>
<xs:enumeration value="string"/>
<xs:enumeration value="date"/>
</xs:restriction>
</xs:simpleType>
| Constructor and Description |
|---|
PropertyDescriptionModel()
Builds an empty PropertyDescriptionModel.
|
PropertyDescriptionModel(String name,
String description,
int type)
Builds a PropertyDescriptionModel.
|
| 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 property is valid.
|
PropertyDescriptionModel |
duplicate()
Duplicates the property.
|
AdditionalInfoModel |
getAdditionalInfo(String name)
Returns an additional info depending on its name.
|
<T> T |
getAdditionalInfo(String name,
Class<T> clazz,
T defaultValue)
Returns an additional info value depending on its name and type.
|
List<AdditionalInfoModel> |
getAdditionalInfos()
Returns the additional info list.
|
String |
getDescription()
Returns the textual description of the property.
|
String |
getName()
Returns the name of the property.
|
int |
getType()
Returns the property type of the property description.
|
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 |
setDescription(String description)
Sets the textual description for the property.
|
void |
setName(String name)
Sets the name of the property.
|
void |
setType(int t)
Sets the property description type.
|
static boolean |
validatePropertyDescriptionModel(PropertyDescriptionModel pdm) |
static boolean |
validatePropertyDescriptionModelType(PropertyDescriptionModel pdm) |
public PropertyDescriptionModel()
public PropertyDescriptionModel(String name, String description, int type)
name - the name of the propertydescription - a textual description for the propertytype - the type of the property (see setType(int) for allowed values)public String getName()
public void setName(String name)
name - the name of the propertypublic String getDescription()
public void setDescription(String description)
description - the associated textual description.public int getType()
public void setType(int t)
t - the property type.public List<AdditionalInfoModel> getAdditionalInfos()
public AdditionalInfoModel getAdditionalInfo(String name)
name - The additional info name.public <T> T getAdditionalInfo(String name, Class<T> clazz, T defaultValue)
name - The additional info name.clazz - The additional info type.defaultValue - The default value if there is no matching additional info.public PropertyDescriptionModel duplicate()
public boolean checkValidity()
public static boolean validatePropertyDescriptionModel(PropertyDescriptionModel pdm)
public static boolean validatePropertyDescriptionModelType(PropertyDescriptionModel pdm)
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