Class ParameterModel

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

public class ParameterModel extends Object implements XMLMarshallable
This class represents the description of a parameter. Each parameter description specifies a type for the parameter. Don't use 'ParameterName' on a subscription parameter or on a charge activation parameter. This attribute has to be used only when building offers.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="parameter">
   <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="description" type="xs:string"/>
     <xs:attribute name="value" type="xs:string" />
     <xs:attribute name="type" type="ParameterType" default="string"/>
     <xs:attribute name="isPrivate" type="xs:boolean" default="false"/>
     <xs:attribute name="parameterName" type="xs:string"/>
   </xs:complexType>
 </xs:element>

 <xs:simpleType name="ParameterType">
   <xs:restriction base="xs:string">
      <xs:enumeration value="number"/>
      <xs:enumeration value="string"/>
      <xs:enumeration value="date"/>
   </xs:restriction>
 </xs:simpleType>

  • Field Details

    • TAG_NAME

      public static final String TAG_NAME
      The value of that constant is the XML tag name of the parameter.
      See Also:
  • Constructor Details

    • ParameterModel

      public ParameterModel()
      Builds an empty ParameterModel.
    • ParameterModel

      public ParameterModel(String name, String description, int type, Object value, boolean isPrivate, String parameterName)
      Builds a ParameterModel.
      Parameters:
      name - name of the parameter.
      description - description of the parameter.
      type - the type of the parameter according to constants described below.
      value - the value of the parameter.
      isPrivate - the visibility of the parameter.
      parameterName - the name of the mapped parameter.
    • ParameterModel

      public ParameterModel(String name, int type, boolean isPrivate)
      Builds a ParameterModel.
      Parameters:
      name - name of the parameter.
      type - the type of the parameter according to constants described below.
      isPrivate - the visibility of the parameter.
  • Method Details

    • getName

      public String getName()
      Returns the name of the parameter.
      Returns:
      The parameter name.
    • setName

      public void setName(String name)
      Sets the name of the parameter.
      Parameters:
      name -
    • getType

      public int getType()
      Returns the type of the parameter. The returned types are :
      Returns:
      the parameter type.
    • setType

      public void setType(int t)
      Sets the type of the parameter. The allowed types are :
      Parameters:
      t - the parameter type.
    • getDescription

      public String getDescription()
      Returns the description of this parameter.
      Returns:
      This parameter description.
      See Also:
    • setDescription

      public void setDescription(String description)
      Sets the description of this parameter.
      Parameters:
      description -
      See Also:
    • getValue

      public Object getValue()
      Returns the parameter value.
      Returns:
      the parameter value.
    • setValue

      public void setValue(Object value)
      Sets the parameter value.
      Parameters:
      value - the parameter value.
    • getStringValue

      public String getStringValue()
      Returns the parameter default value seen as a String if it is possible.
      Returns:
      the parameter value seen as a String.
    • getNumberValue

      public BigDecimal getNumberValue()
      Returns the parameter default value seen as a BigDecimal if it is possible.
      Returns:
      the parameter default value seen as a BigDecimal.
    • getDateValue

      public Date getDateValue()
      Returns the parameter default value seen as a Date if it is possible.
      Returns:
      the parameter value seen as a Date.
    • getParameterName

      public String getParameterName()
      Returns the mapped parameter name. Don't use 'ParameterName' on a subscription parameter or on a charge activation parameter. This attribute has to be used only when building offers.
      Returns:
      the name of the mapped parameter.
    • setParameterName

      public void setParameterName(String parameterName)
      Sets the mapped parameter name. Don't use 'ParameterName' on a subscription parameter or on a charge activation parameter. This attribute has to be used only when building offers.
      Parameters:
      parameterName - the name of the mapped parameter.
    • isPrivate

      public boolean isPrivate()
      Returns the visibility of the parameter.
      Returns:
      true if the parameter is private.
    • setPrivate

      public void setPrivate(boolean isPrivate)
      Sets the parameter visibility.
      Parameters:
      isPrivate - the level of the visibility.
    • checkValidity

      public boolean checkValidity()
      Tests if the parameter is valid (non void name, incompatible type, value...).
      Returns:
      true if the parameter is valid, false otherwise.
    • duplicate

      public ParameterModel duplicate()
      Returns a clone of the parameter.
      Returns:
      the clone of the parameter.
    • getAdditionalInfoList

      public List<AdditionalInfoModel> getAdditionalInfoList()
      Gets the list of Additional Informations.
      Returns:
      The list of Additional Informations
    • 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 name, 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:
      name - 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