Class OutMacroPropertyModel

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

public class OutMacroPropertyModel extends Object implements XMLMarshallable
This class represents an output property of a pricing macro and contains a name, a description, a type and a default value. The type of an output property must be string, number, or date.
See Also:

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="outProperty">
   <xs:complexType>
     <xs:attribute name="name" type="xs:string"/>
     <xs:attribute name="defaultValue" type="xs:string"/>
     <xs:attribute name="type" type="xs:string"/>
     <xs:attribute name="description" type="xs:string"/>
   </xs:complexType>
 </xs:element>

  • Constructor Details

    • OutMacroPropertyModel

      public OutMacroPropertyModel()
      Constructs an empty output property model.
    • OutMacroPropertyModel

      public OutMacroPropertyModel(String name, String description, int type, Object defaultValue)
      Constructs an output property with a name, a description, a type and a default value. (see setType(int) for allowed type value)
      Parameters:
      name - the name of the output property.
      description - the description of the output property.
      type - the type of the output property.
      defaultValue - the default value of the output property.
    • OutMacroPropertyModel

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

    • getName

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

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

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

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

      public int getType()
      Gets the type of the output property. Returned values are :
      Returns:
      the type of the output property.
    • setType

      public void setType(int t)
      Sets the type of the output property. Allowed values are :
      Parameters:
      t - the type of the output property.
    • getDefaultValue

      public Object getDefaultValue()
      Gets the default value of the output property.
      Returns:
      the default value of the output property.
    • setDefaultValue

      public void setDefaultValue(Object defaultValue)
      Sets the default value of the output property.
      Parameters:
      defaultValue - the default value of the output property.
    • getStringValue

      public String getStringValue()
      Gets the default value of the output property as a string.
      Returns:
      the default value of the output property, or null if the default value is not a string.
    • getNumberValue

      public BigDecimal getNumberValue()
      Gets the default value of the output property as a decimal.
      Returns:
      the default value of the output property, or null if the default value is not a decimal.
    • getDateValue

      public Date getDateValue()
      Gets the default value of the output property as a date.
      Returns:
      the default value of the output property, or null if the default value is not a date.
    • checkValidity

      public boolean checkValidity()
      Returns true if the property is valid. Property is valid if its name is not null or empty, and if its default value is valid according to the specified type (see setType(int)).
      Returns:
      true if the property 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
    • 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
    • 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
    • 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