Class AdditionalInfoModel

java.lang.Object
com.highdeal.hci.HCIModelAdapter
com.highdeal.hci.AdditionalInfoModel
All Implemented Interfaces:
ITagNameProvider, IXMLMarshallable, XMLMapping, XMLMarshallable

public class AdditionalInfoModel extends HCIModelAdapter implements XMLMapping
The AdditionalInfoModel represents an information used as search criteria to find Data.

AdditionalInfoModel is an element of the Data. It is unique by its name in the Data. The content of the information is set in the value of the AdditionalInfoModel. The value can be a string, a date or a number.

The main goal of this element inside the Data is to be used as a search criteria in the Search Operations. to find Data in the system. A search criteria is applicable on the name and the value of the AdditionInfoModel. That's useful for external system.

The AdditionalInfoModel is composed of:

  • A name which identifies an unique additional information inside the Data.
  • A description allowing a better understanding about the presence of this additional information inside the Data.
  • A value:
    • A string value
    • A date value
    • A number value

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:complexType name="AdditionalInfoType">
    <xs:sequence>
      <xs:element name="description" type="DescriptionType" minOccurs="0" maxOccurs="1" />
      <xs:choice>
        <xs:element ref="string" />
        <xs:element ref="date" />
        <xs:element ref="number" />
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" />
  </xs:complexType>

  • Field Details

    • TAG_NAME

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

    • AdditionalInfoModel

      public AdditionalInfoModel()
      Creates an additional information.
    • AdditionalInfoModel

      public AdditionalInfoModel(String name, DescriptionModel description, ValueType type, Object value)
      Creates an additional information.
      Parameters:
      name - the name of the additional information
      description - the description of the additional information
      type - the type of the value of the additional information
      value - the value of the additional information
  • Method Details

    • getName

      public String getName()
      Gets the name of the additional information defined by the user. The name is unique within the ChargePlanModel.
      Returns:
      the name of the additional information defined by the user.
    • setName

      public void setName(String name)
      Sets the name of the additional information defined by the user. The name is unique within the ChargePlanModel.
      Parameters:
      name - the name of the additional information defined by the user.
    • getDescription

      public String getDescription()
      Gets the description of the additional information. Allow a better understanding about the presence of this additional information inside the ChargePlanModel.
      Returns:
      the description of the additional information.
    • setDescription

      public void setDescription(String description)
      Sets the description of the additional information. Allow a better understanding about the presence of this additional information inside the ChargePlanModel.
      Parameters:
      description - the description of the additional information.
    • getType

      public ValueType getType()
      Gets the type of the value. When the type is null, then the value is null. When the value is null, then the type isn't necessary null.
      Returns:
      the type of the value
    • setType

      public void setType(ValueType type)
      Sets the type of the value. When the type given in argument is different of the internal type, then the value is set to null.
      Parameters:
      type - the type of the value.
    • getStringValue

      public String getStringValue()
      Gets the value as a String if the type is ValueType.STRING.
      Returns:
      the value as a String if the type is ValueType.STRING, null otherwise.
    • setStringValue

      public void setStringValue(String value)
      Sets a String value and set the type to ValueType.STRING.
      Parameters:
      value - the String value
    • getDateValue

      public Date getDateValue()
      Gets the value as a Date if the type is ValueType.DATE.
      Returns:
      the value as a Date if the type is ValueType.DATE, null otherwise.
    • setDateValue

      public void setDateValue(Date value)
      Sets the Date value and set the type to ValueType.DATE.
      Parameters:
      value - the Date value
    • getNumberValue

      public BigDecimal getNumberValue()
      Gets the value as a BigDecimal if the type is ValueType.NUMBER.
      Returns:
      the value as a BigDecimal if the type is ValueType.NUMBER, null otherwise.
    • setNumberValue

      public void setNumberValue(BigDecimal value)
      Sets the BigDecimal value and set the type to ValueType.NUMBER.
      Parameters:
      value - the BigDecimal value
    • 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
    • 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
    • marshalAttributes

      public void marshalAttributes(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the attributes of an object.
      Specified by:
      marshalAttributes in interface IXMLMarshallable
      Parameters:
      output - The XML output to marshal the object attributes into
    • marshalChildren

      public void marshalChildren(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the child objects of an object.
      Specified by:
      marshalChildren in interface IXMLMarshallable
      Parameters:
      output - The XML output to marshal the child objects into
    • getTagName

      public String getTagName()
      Description copied from interface: ITagNameProvider
      Gets the XML tag name of the HCI model.
      Specified by:
      getTagName in interface ITagNameProvider
      Returns:
      The XML tag name
    • getClass

      public Class<?> getClass(String nsUri, String tag, XMLAttributes atts)
      Description copied from interface: XMLMapping
      Returns the Java class for a specified XML tag and its attributes in a namespace.
      Specified by:
      getClass in interface XMLMapping
      Parameters:
      nsUri - The unique resource identifier of the namespace of the XML tag
      tag - The local part of the XML tag
      atts - The attributes of the XML tag
      Returns:
      A Java class with a default constructor