ibilling.client
Class XMLTransformationHelper

java.lang.Object
  extended by ibilling.client.XMLTransformationHelper

public class XMLTransformationHelper
extends java.lang.Object

Helper class to transform Library objects to and from XML. Uses Helper and ElementFacade.

Since:
1.0

Field Summary
private  ElementFacade facade
          The facade.
 
Constructor Summary
XMLTransformationHelper(ElementFacade facade)
          Instantiates a new xML transformation helper.
 
Method Summary
 void addAtribute(java.lang.String attributeName, java.lang.Object value)
          Adds the atribute.
private  void adjustmentFromXML(Adjustment clientObject)
          Adjustment from xml.
private  void adjustmentToXML(Adjustment clientObject)
          Adjustment to xml.
 void assetTransactionFromXML(AssetTransaction clientObject, TransformationContext context)
          Asset transaction from xml.
 void assetTransactionToXML(AssetTransaction clientObject)
          Asset transaction to xml.
private  void captureInfoFromXML(CaptureInfo clientObject)
          Capture info from xml.
private  void captureInfoToXML(CaptureInfo clientObject)
          Capture info to xml.
private  void chargeFromXML(Charge clientObject)
          Charge from xml.
private  void chargeToXML(Charge clientObject)
          Charge to xml.
 void customerAccountFromXML(CustomerAccount clientObject)
          Customer account from xml.
 void customerAccountToXML(CustomerAccount clientObject)
          Customer account to xml.
 java.util.Map<java.lang.String,java.lang.Object> getAccountTransactionParameters()
          Gets the account transaction parameters.
 void getAttributeFromRoot(java.util.Map<java.lang.String,java.lang.Object> config)
          Map config from xml
 java.lang.Boolean getBoolean(java.lang.String attributeName)
          Gets the boolean.
private  int getCountCharge(java.util.List<ElementFacade> children)
          Gets the count charge.
 java.util.Map<java.lang.String,java.lang.Object> getCustomerAccountParameters()
          Gets the customer account parameters.
 java.util.Date getDate(java.lang.String attributeName)
          Gets the date.
 java.lang.Integer getInteger(java.lang.String attributeName)
          Gets the integer.
private  int getLengthPaymentPlan(java.util.List<Charge> charges)
          Gets the length payment plan.
 java.util.Map<java.lang.String,java.lang.Object> getLoadObjectParameters()
          Gets loadObject parameters
 java.lang.Long getLong(java.lang.String attributeName)
          Gets the long.
 java.util.Map<java.lang.String,java.lang.Object> getPaymentOptionParameters()
          Gets the payment option parameters.
 java.util.Map<java.lang.String,java.lang.Object> getPaymentPlanParameters()
          Gets the payment plan parameters.
 java.lang.String getString(java.lang.String attributeName)
          Gets the string.
 boolean isAttributeValueNull(java.lang.String attributeName)
          Checks if is attribute value null.
 void paymentOptionFromXML(PaymentOption clientObject, TransformationContext context)
          Payment option from xml.
 void paymentOptionToXML(PaymentOption clientObject)
          Payment option to xml.
 void paymentPlanFromXML(PaymentPlan clientObject, TransformationContext context)
          Payment plan from xml.
 void paymentPlanToXML(PaymentPlan clientObject)
          Payment plan to xml.
static void queryParametersToXML(ElementFacade facade, java.util.Map<java.lang.String,java.lang.Object> parameters)
          Query parameters to xml.
private  java.lang.String refIdToXML(java.lang.Long id, java.lang.Integer refId)
          Executes mapping refid to XML
 void revenueTransactionFromXML(RevenueTransaction clientObject, TransformationContext context)
          Revenue transaction from xml.
 void revenueTransactionToXML(RevenueTransaction clientObject)
          Revenue transaction to xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

facade

private ElementFacade facade
The facade.

Constructor Detail

XMLTransformationHelper

public XMLTransformationHelper(ElementFacade facade)
Instantiates a new xML transformation helper.

Parameters:
facade - the facade
Method Detail

customerAccountToXML

public void customerAccountToXML(CustomerAccount clientObject)
Customer account to xml.

Parameters:
clientObject - the client object

customerAccountFromXML

public void customerAccountFromXML(CustomerAccount clientObject)
Customer account from xml.

Parameters:
clientObject - the client object

paymentOptionToXML

public void paymentOptionToXML(PaymentOption clientObject)
Payment option to xml.

Parameters:
clientObject - the client object

paymentOptionFromXML

public void paymentOptionFromXML(PaymentOption clientObject,
                                 TransformationContext context)
Payment option from xml.

Parameters:
clientObject - the client object
context - the context
Throws:
DataConversionException - the data conversion exception
ClientException - the client exception

revenueTransactionToXML

public void revenueTransactionToXML(RevenueTransaction clientObject)
Revenue transaction to xml.

Parameters:
clientObject - the client object

revenueTransactionFromXML

public void revenueTransactionFromXML(RevenueTransaction clientObject,
                                      TransformationContext context)
Revenue transaction from xml.

Parameters:
clientObject - the client object
context - the context

assetTransactionToXML

public void assetTransactionToXML(AssetTransaction clientObject)
Asset transaction to xml.

Parameters:
clientObject - the client object

assetTransactionFromXML

public void assetTransactionFromXML(AssetTransaction clientObject,
                                    TransformationContext context)
Asset transaction from xml.

Parameters:
clientObject - the client object
context - the context

captureInfoToXML

private void captureInfoToXML(CaptureInfo clientObject)
Capture info to xml.

Parameters:
clientObject - the client object

captureInfoFromXML

private void captureInfoFromXML(CaptureInfo clientObject)
Capture info from xml.

Parameters:
clientObject - the client object

adjustmentToXML

private void adjustmentToXML(Adjustment clientObject)
Adjustment to xml.

Parameters:
clientObject - the client object

adjustmentFromXML

private void adjustmentFromXML(Adjustment clientObject)
Adjustment from xml.

Parameters:
clientObject - the client object

chargeToXML

private void chargeToXML(Charge clientObject)
Charge to xml.

Parameters:
clientObject - the client object

chargeFromXML

private void chargeFromXML(Charge clientObject)
Charge from xml.

Parameters:
clientObject - the client object

paymentPlanToXML

public void paymentPlanToXML(PaymentPlan clientObject)
Payment plan to xml.

Parameters:
clientObject - the client object

paymentPlanFromXML

public void paymentPlanFromXML(PaymentPlan clientObject,
                               TransformationContext context)
Payment plan from xml.

Parameters:
clientObject - the client object
context - the context

queryParametersToXML

public static void queryParametersToXML(ElementFacade facade,
                                        java.util.Map<java.lang.String,java.lang.Object> parameters)
Query parameters to xml.

Parameters:
facade - the facade
parameters - the parameters

getCustomerAccountParameters

public java.util.Map<java.lang.String,java.lang.Object> getCustomerAccountParameters()
Gets the customer account parameters.

Returns:
the customer account parameters

getPaymentOptionParameters

public java.util.Map<java.lang.String,java.lang.Object> getPaymentOptionParameters()
Gets the payment option parameters.

Returns:
the payment option parameters

getPaymentPlanParameters

public java.util.Map<java.lang.String,java.lang.Object> getPaymentPlanParameters()
Gets the payment plan parameters.

Returns:
the payment plan parameters

getAccountTransactionParameters

public java.util.Map<java.lang.String,java.lang.Object> getAccountTransactionParameters()
Gets the account transaction parameters.

Returns:
the account transaction parameters

getLoadObjectParameters

public java.util.Map<java.lang.String,java.lang.Object> getLoadObjectParameters()
Gets loadObject parameters

Returns:
the load object parameters

getAttributeFromRoot

public void getAttributeFromRoot(java.util.Map<java.lang.String,java.lang.Object> config)
Map config from xml

Parameters:
config - Map

getString

public java.lang.String getString(java.lang.String attributeName)
Gets the string.

Parameters:
attributeName - the attribute name
Returns:
the string

getInteger

public java.lang.Integer getInteger(java.lang.String attributeName)
Gets the integer.

Parameters:
attributeName - the attribute name
Returns:
the integer

getLong

public java.lang.Long getLong(java.lang.String attributeName)
Gets the long.

Parameters:
attributeName - the attribute name
Returns:
the long

getBoolean

public java.lang.Boolean getBoolean(java.lang.String attributeName)
Gets the boolean.

Parameters:
attributeName - the attribute name
Returns:
the boolean

getDate

public java.util.Date getDate(java.lang.String attributeName)
Gets the date.

Parameters:
attributeName - the attribute name
Returns:
the date

addAtribute

public void addAtribute(java.lang.String attributeName,
                        java.lang.Object value)
Adds the atribute.

Parameters:
attributeName - the attribute name
value - the value

isAttributeValueNull

public boolean isAttributeValueNull(java.lang.String attributeName)
Checks if is attribute value null.

Parameters:
attributeName - the attribute name
Returns:
true, if is attribute value null

refIdToXML

private java.lang.String refIdToXML(java.lang.Long id,
                                    java.lang.Integer refId)
Executes mapping refid to XML

Parameters:
id -
refId -
Returns:
String

getCountCharge

private int getCountCharge(java.util.List<ElementFacade> children)
Gets the count charge.

Parameters:
children - the children
Returns:
the count charge

getLengthPaymentPlan

private int getLengthPaymentPlan(java.util.List<Charge> charges)
Gets the length payment plan.

Parameters:
charges - the charges
Returns:
the length payment plan