public class ProductModel extends java.lang.Object implements XMLMarshallable, ICatalogObject
Java class represents a chargeable item package (aka product) - that corresponds
to something that can be charged.
In SAP Convergent Charging, the functional concept of product is revoked and replaced by the concept of chargeable item package.
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="product">
<xs:complexType>
<xs:sequence>
<xs:element ref="item" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="code" type="xs:string" use="required"/>
<xs:attribute name="reference" type="xs:string"/>
<xs:attribute name="vendor" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG_NAME |
| Constructor and Description |
|---|
ProductModel()
Builds an empty product.
|
ProductModel(java.lang.String code,
java.lang.String description)
Builds a product from a code and a description.
|
ProductModel(java.lang.String code,
java.lang.String description,
java.lang.String p)
Builds a product from a code, a description and a vendor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChargeableItemDescription(ChargeableItemDescriptionModel cid)
Adds a chargeable item description to the list which defines
the product.
|
void |
addChild(java.lang.String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
boolean |
checkValidity()
Tests if the product is valid.
|
java.util.Vector<ChargeableItemDescriptionModel> |
getChargeableItemDescriptions()
Returns the list of chargeable item description which defines
the product.
|
java.lang.String |
getCode()
Returns the code of the product.
|
java.lang.String |
getDescription()
Returns the description of the product.
|
java.lang.String |
getOwner()
Returns the catalog owner of the object.
|
java.lang.String |
getReference()
Returns the reference of the product.
|
java.lang.String |
getVendor()
Returns the vendor of the product.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
removeChargeableItemDescription(int index)
Removes a chargeable item description from the list which defines
the product.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setChargeableItemDescriptions(java.util.Vector<ChargeableItemDescriptionModel> descriptions)
Sets the list of chargeable item description which defines
the product.
|
void |
setCode(java.lang.String code)
Sets the code of the product.
|
void |
setDescription(java.lang.String description)
Sets the description of the product.
|
void |
setReference(java.lang.String reference)
Sets the reference of the product.
|
void |
setVendor(java.lang.String v)
Sets the vendor of the product.
|
public static final java.lang.String TAG_NAME
public ProductModel()
public ProductModel(java.lang.String code,
java.lang.String description)
code - The code of the productdescription - The description of the productpublic ProductModel(java.lang.String code,
java.lang.String description,
java.lang.String p)
code - The code of the productdescription - The description of the productp - The vendor of the productpublic java.lang.String getReference()
public void setReference(java.lang.String reference)
reference - The referencepublic java.lang.String getCode()
public void setCode(java.lang.String code)
code - The code of this productpublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description - the description of this product.public java.util.Vector<ChargeableItemDescriptionModel> getChargeableItemDescriptions()
ChargeableItemDescriptionModel.public void setChargeableItemDescriptions(java.util.Vector<ChargeableItemDescriptionModel> descriptions)
descriptions - A Vector of ChargeableItemDescriptionModel.public java.lang.String getOwner()
ICatalogObjectgetOwner in interface ICatalogObjectpublic java.lang.String getVendor()
public void setVendor(java.lang.String v)
v - The vendor of the productpublic void addChargeableItemDescription(ChargeableItemDescriptionModel cid)
cid - The ChargeableItemDescriptionModel to addpublic void removeChargeableItemDescription(int index)
index - The index of the chargeable item description to removepublic boolean checkValidity()
public void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(java.lang.String tagName,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(java.lang.String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into