anon.pay.xml
Class XMLPaymentSettings

java.lang.Object
  extended by anon.pay.xml.XMLPaymentSettings
All Implemented Interfaces:
IXMLEncodable

public class XMLPaymentSettings
extends java.lang.Object
implements IXMLEncodable

XMl representation of the payment setting (flatrate price, duration etc) simple wrapper around the data of table paymentsettings, cotains a Hashtable whose keys and values correspond to the name and curvalue columns of table paymentsettings

Author:
Elmar Schraml

Field Summary
private  org.w3c.dom.Document m_docTheSettings
           
private  java.util.Hashtable m_paymentSettings
           
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
XMLPaymentSettings()
           
XMLPaymentSettings(org.w3c.dom.Document document)
           
XMLPaymentSettings(org.w3c.dom.Element xml)
           
XMLPaymentSettings(java.util.Hashtable allSettings)
           
XMLPaymentSettings(java.lang.String xml)
           
 
Method Summary
 void addSetting(java.lang.String name, java.lang.String value)
           
 java.util.Calendar getEndDate()
          getEndDate: utility method that returns the enddate of a flat purchased now (i.e.
 java.util.Enumeration getSettingNames()
           
 java.lang.String getSettingValue(java.lang.String name)
          getSettingValue
private  org.w3c.dom.Element internal_toXmlElement(org.w3c.dom.Document a_doc)
           
private  void setValues(org.w3c.dom.Element elemRoot)
           
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Return an element that can be appended to the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_paymentSettings

private java.util.Hashtable m_paymentSettings

m_docTheSettings

private org.w3c.dom.Document m_docTheSettings
Constructor Detail

XMLPaymentSettings

public XMLPaymentSettings(java.lang.String xml)
                   throws java.lang.Exception
Throws:
java.lang.Exception

XMLPaymentSettings

public XMLPaymentSettings()

XMLPaymentSettings

public XMLPaymentSettings(java.util.Hashtable allSettings)

XMLPaymentSettings

public XMLPaymentSettings(org.w3c.dom.Element xml)
                   throws java.lang.Exception
Throws:
java.lang.Exception

XMLPaymentSettings

public XMLPaymentSettings(org.w3c.dom.Document document)
                   throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

addSetting

public void addSetting(java.lang.String name,
                       java.lang.String value)

getSettingValue

public java.lang.String getSettingValue(java.lang.String name)
getSettingValue

Parameters:
name - String: name of the settings as used in configfile/ database
Returns:
String value of the settings, or null if it's not set

getEndDate

public java.util.Calendar getEndDate()
getEndDate: utility method that returns the enddate of a flat purchased now (i.e. Date() + flat_duration * flat_duration_unit

Returns:
Calendar: set to the time of expiration of a flatrate bought right now

getSettingNames

public java.util.Enumeration getSettingNames()

internal_toXmlElement

private org.w3c.dom.Element internal_toXmlElement(org.w3c.dom.Document a_doc)

setValues

private void setValues(org.w3c.dom.Element elemRoot)
                throws java.lang.Exception
Throws:
java.lang.Exception

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Description copied from interface: IXMLEncodable
Return an element that can be appended to the document. This Method must not change the document in any way!

Specified by:
toXmlElement in interface IXMLEncodable
Parameters:
a_doc - a document
Returns:
the interface as xml element