Package com.highdeal.pnr.hci
Class PropertyDescriptionModel
java.lang.Object
com.highdeal.pnr.hci.PropertyDescriptionModel
- All Implemented Interfaces:
XMLMarshallable
This class represents the description of a property as seen by a client application.
Each property description specifies a type, a name and a description for the property.
XML API for HCI
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 Summary
ConstructorsConstructorDescriptionBuilds an empty PropertyDescriptionModel.PropertyDescriptionModel(String name, String description, int type) Builds a PropertyDescriptionModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String name, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.booleanReturns true if the property is valid.Duplicates the property.getAdditionalInfo(String name) Returns an additional info depending on its name.<T> TgetAdditionalInfo(String name, Class<T> clazz, T defaultValue) Returns an additional info value depending on its name and type.Returns the additional info list.Returns the textual description of the property.getName()Returns the name of the property.intgetType()Returns the property type of the property description.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetDescription(String description) Sets the textual description for the property.voidSets the name of the property.voidsetType(int t) Sets the property description type.static booleanstatic boolean
-
Constructor Details
-
PropertyDescriptionModel
public PropertyDescriptionModel()Builds an empty PropertyDescriptionModel. -
PropertyDescriptionModel
Builds a PropertyDescriptionModel.- Parameters:
name- the name of the propertydescription- a textual description for the propertytype- the type of the property (seesetType(int)for allowed values)
-
-
Method Details
-
getName
Returns the name of the property.- Returns:
- the property name.
-
setName
Sets the name of the property.- Parameters:
name- the name of the property
-
getDescription
Returns the textual description of the property.- Returns:
- the description of the property.
-
setDescription
Sets the textual description for the property.- Parameters:
description- the associated textual description.
-
getType
public int getType()- Returns:
- the property type.
-
setType
public void setType(int t) - Parameters:
t- the property type.
-
getAdditionalInfos
Returns the additional info list.- Returns:
- the additional info list.
-
getAdditionalInfo
Returns an additional info depending on its name.- Parameters:
name- The additional info name.- Returns:
- The additional info or null if not found.
-
getAdditionalInfo
Returns an additional info value depending on its name and type.- Parameters:
name- The additional info name.clazz- The additional info type.defaultValue- The default value if there is no matching additional info.- Returns:
- the additional info value or the default value if not found.
-
duplicate
Duplicates the property.- Returns:
- a clone of the property.
-
checkValidity
public boolean checkValidity()Returns true if the property is valid. Property is valid if its name is not null or empty.- Returns:
- true if the property is valid, false otherwise.
-
validatePropertyDescriptionModel
-
validatePropertyDescriptionModelType
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
name- The name of tag for the childchild- The child to be added
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-