Package com.highdeal.pnr.hci
Class ParameterModel
java.lang.Object
com.highdeal.pnr.hci.ParameterModel
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBuilds an empty ParameterModel.ParameterModel(String name, int type, boolean isPrivate) Builds a ParameterModel.ParameterModel(String name, String description, int type, Object value, boolean isPrivate, String parameterName) Builds a ParameterModel. -
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.booleanTests if the parameter is valid (non void name, incompatible type, value...).Returns a clone of the parameter.Gets the list ofAdditional Informations.Returns the parameter default value seen as a Date if it is possible.Returns the description of this parameter.getName()Returns the name of the parameter.Returns the parameter default value seen as a BigDecimal if it is possible.Returns the mapped parameter name.Returns the parameter default value seen as a String if it is possible.intgetType()Returns the type of the parameter.getValue()Returns the parameter value.booleanReturns the visibility of the parameter.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 description of this parameter.voidSets the name of the parameter.voidsetParameterName(String parameterName) Sets the mapped parameter name.voidsetPrivate(boolean isPrivate) Sets the parameter visibility.voidsetType(int t) Sets the type of the parameter.voidSets the parameter value.
-
Field Details
-
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
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
Returns the name of the parameter.- Returns:
- The parameter name.
-
setName
Sets the name of the parameter.- Parameters:
name-
-
getType
public int getType()- Returns:
- the parameter type.
-
setType
public void setType(int t) - Parameters:
t- the parameter type.
-
getDescription
Returns the description of this parameter.- Returns:
- This parameter description.
- See Also:
-
setDescription
Sets the description of this parameter.- Parameters:
description-- See Also:
-
getValue
Returns the parameter value.- Returns:
- the parameter value.
-
setValue
Sets the parameter value.- Parameters:
value- the parameter value.
-
getStringValue
Returns the parameter default value seen as a String if it is possible.- Returns:
- the parameter value seen as a String.
-
getNumberValue
Returns the parameter default value seen as a BigDecimal if it is possible.- Returns:
- the parameter default value seen as a BigDecimal.
-
getDateValue
Returns the parameter default value seen as a Date if it is possible.- Returns:
- the parameter value seen as a Date.
-
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
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:
trueif 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:
trueif the parameter is valid,falseotherwise.
-
duplicate
Returns a clone of the parameter.- Returns:
- the clone of the parameter.
-
getAdditionalInfoList
Gets the list ofAdditional Informations.- Returns:
- The list of Additional Informations
-
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
-