SAP CC 1.0
API 4.2 (Core)

com.highdeal.pnr.hci
Class ProductModel

java.lang.Object
  extended by com.highdeal.pnr.hci.ProductModel
All Implemented Interfaces:
XMLMarshallable

public class ProductModel
extends java.lang.Object
implements XMLMarshallable

This class represents a product that corresponds to something that can be charged.


XML Schema 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>

Constructor Summary
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.
 
Method Summary
 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 objects, the child represents the marshallable object to be added into the content tree.
 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 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, and of 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 tag beeing 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductModel

public ProductModel()
Builds an empty product.


ProductModel

public ProductModel(java.lang.String code,
                    java.lang.String description)
Builds a product from a code and a description.

Parameters:
code - the code of the product.
description - the description of the product.

ProductModel

public ProductModel(java.lang.String code,
                    java.lang.String description,
                    java.lang.String p)
Builds a product from a code, a description and a vendor.

Parameters:
code - the code of the product.
description - the description of the product.
p - the vendor of the product.
Method Detail

getReference

public java.lang.String getReference()
Returns the reference of the product.

Returns:
the reference of the product.

setReference

public void setReference(java.lang.String reference)
Sets the reference of the product.

Parameters:
reference - the reference.

getCode

public java.lang.String getCode()
Returns the code of the product.

Returns:
the code of the product.

setCode

public void setCode(java.lang.String code)
Sets the code of the product.

Parameters:
code - the code of this product.

getDescription

public java.lang.String getDescription()
Returns the description of the product.

Returns:
the description of the product.

setDescription

public void setDescription(java.lang.String description)
Sets the description of the product.

Parameters:
description - the description of this product.

getChargeableItemDescriptions

public java.util.Vector<ChargeableItemDescriptionModel> getChargeableItemDescriptions()
Returns the list of chargeable item description which defines the product.

Returns:
a Vector of ChargeableItemDescriptionModel.

setChargeableItemDescriptions

public void setChargeableItemDescriptions(java.util.Vector<ChargeableItemDescriptionModel> descriptions)
Sets the list of chargeable item description which defines the product.

Parameters:
descriptions - a Vector of ChargeableItemDescriptionModel.

getVendor

public java.lang.String getVendor()
Returns the vendor of the product.

Returns:
the vendor of the product.

setVendor

public void setVendor(java.lang.String v)
Sets the vendor of the product.

Parameters:
v - the vendor of the product.

addChargeableItemDescription

public void addChargeableItemDescription(ChargeableItemDescriptionModel cid)
Adds a chargeable item description to the list which defines the product.

Parameters:
cid - the ChargeableItemDescriptionModel to add.

removeChargeableItemDescription

public void removeChargeableItemDescription(int index)
Removes a chargeable item description from the list which defines the product.

Parameters:
index - the index of the chargeable item description to remove.

checkValidity

public boolean checkValidity()
Tests if the product is valid. Product is valid if its name is not null or empty, and if all chargeable items are valid with unique names.

Returns:
true if the product is valid, false otherwise.

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the tag beeing processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - the XML attributes of the current tag.

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the objects, the child represents the marshallable object to be added into the content tree.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - the name of tag for the child.
child - the child to be added.

addCharacterData

public void addCharacterData(java.lang.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, and of its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - the XML output to marshall the object into.

SAP CC 1.0
API 4.2 (Core)


API Reference - July 2009

SAP Convergent Charging 1.0 (build R4.2.1.35.0.0)
CONVERGENT CHARGING 4.2

(c) Copyright 2009 SAP AG. All rights reserved.