Class OutAttributeModel

java.lang.Object
com.highdeal.pnr.hci.OutAttributeModel
All Implemented Interfaces:
XMLMarshallable

public class OutAttributeModel extends Object implements XMLMarshallable
This class represents an output attribute in a translation table and contains a name, a description, a type and a default value.
See Also:

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="outAttribute">
   <xs:complexType>
     <xs:attribute name="name" type="xs:string" use="required"/>
     <xs:attribute name="defaultValue" type="xs:string" use="required"/>
     <xs:attribute name="type" type="xs:string" use="required"/>
     <xs:attribute name="description" type="xs:string"/>
   </xs:complexType>
 </xs:element>

  • Constructor Details

    • OutAttributeModel

      public OutAttributeModel()
      Constructs an empty output attribute model.
    • OutAttributeModel

      public OutAttributeModel(String name, String description, int type, Object value)
      Constructs an output attribute with a name, a description, a type and a default value. (see setType(int) for type allowed values).
      Parameters:
      name - the name of the attribute.
      description - the description of the attribute.
      type - the type of the attribute.
      value - the value of the attribute.
  • Method Details

    • getName

      public String getName()
      Returns the name of the output attribute.
      Returns:
      the name of the output attribute.
    • setName

      public void setName(String n)
      Sets the name of the output attribute.
      Parameters:
      n - the name of the output attribute.
    • getDescription

      public String getDescription()
      Returns the description of the output attribute.
      Returns:
      the description of the output attribute.
    • setDescription

      public void setDescription(String d)
      Sets the description of the output attribute.
      Parameters:
      d - the description of the output attribute.
    • getType

      public int getType()
      Returns the type of the output attribute. Returned types are :
      Returns:
      the type of the output attribute.
    • setType

      public void setType(int type)
      Sets the type of the output attribute. Allowed types are :
      Parameters:
      type - the type of the output attribute.
    • setValue

      public void setValue(Object v)
      Sets the value of the output attribute.
      Parameters:
      v - the value of the output attribute.
    • getValue

      public Object getValue()
      Returns the value of the output attribute.
      Returns:
      the value of the output attribute.
    • checkValidity

      public boolean checkValidity()
      Returns true if the output attribute is valid. Attribute is valid if its name is not null or empty and if its type is valid (see setType(int).
      Returns:
      true if the attribute is valid, false otherwise.
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Specified by:
      setAttributes in interface XMLMarshallable
      Parameters:
      atts - The XML attributes of the current element
    • addChild

      public void addChild(String tagName, XMLMarshallable child)
      Description copied from interface: XMLMarshallable
      Adds a child to the object, the child representing the marshallable object which must be added to the element.
      Specified by:
      addChild in interface XMLMarshallable
      Parameters:
      tagName - The name of tag for the child
      child - The child to be added
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Specified by:
      addCharacterData in interface XMLMarshallable
      Parameters:
      cData - The character data to be added
    • marshal

      public void marshal(XMLOutputter output)
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into