|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectibilling.client.ElementFacade
public class ElementFacade
The class is used to abstract XML processing logic and simplify library's code porting onto other languages/platforms. The class implements several common XML related functionality using JDOM as its underlying tool. Every instance of the class acts as a wrapper around an Element
| Field Summary | |
|---|---|
(package private) org.jdom.Element |
element
The element used as the base object for this facade |
| Constructor Summary | |
|---|---|
ElementFacade(org.jdom.Element element)
Instantiates a new element facade using specified element as the base object |
|
ElementFacade(java.lang.String elementName)
Instantiates a new element facade and creates a new element with the given name |
|
| Method Summary | |
|---|---|
void |
addContent(java.lang.String content)
Assigns text content to the base element (creates a first child as text node with the specified value) |
ElementFacade |
createChild(java.lang.String childName)
Creates and appends child Element node to the base element |
java.lang.String |
getAttributeValue(java.lang.String attributeName)
Returns element's attribute value as string |
java.lang.Boolean |
getBoolean(java.lang.String attributeName)
Returns value of the specified attribute as boolean |
ElementFacade |
getChild(java.lang.String name)
Returns first child element with the specified name |
java.util.Date |
getDate(java.lang.String attributeName)
Returns value of the specified attribute as Date. |
org.jdom.Document |
getDocument()
Returns the document used to create the base element |
java.lang.Integer |
getInteger(java.lang.String attributeName)
Returns value of the specified attribute as integer |
java.lang.Long |
getLong(java.lang.String attributeName)
Returns value of the specified attribute as long |
java.lang.String |
getName()
Returns the name of the element |
java.util.List<ElementFacade> |
getNodeList()
Returns list of FacadeElement wrapped around child Element nodes of the base element |
java.lang.String |
getString(java.lang.String attributeName)
Returns value of the specified attribute as string |
java.lang.String |
getText()
Returns text content (content of the first child) of the base element |
boolean |
isAttributeValueNull(java.lang.String attributeName)
Checks if is attribute value null. |
void |
setAttribute(java.lang.String attributeName,
java.lang.Object value)
Assigns value of the named attribute to the base element. |
static void |
setAttributesToRoot(ElementFacade facade,
java.lang.Integer merchantAccountCode,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.Object> config)
Assigns merchantAccount/password attributes and forms config element to the specified ElementFacade (usually representing the root) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
org.jdom.Element element
| Constructor Detail |
|---|
public ElementFacade(org.jdom.Element element)
element - the elementpublic ElementFacade(java.lang.String elementName)
elementName - the element name| Method Detail |
|---|
public java.lang.String getName()
public ElementFacade getChild(java.lang.String name)
name - name of the child element
public java.lang.String getText()
public java.lang.String getAttributeValue(java.lang.String attributeName)
attributeName - name of the attribute
public ElementFacade createChild(java.lang.String childName)
childName - name of the child node to create
public java.util.List<ElementFacade> getNodeList()
public void setAttribute(java.lang.String attributeName,
java.lang.Object value)
attributeName - name of the attribute to assignvalue - desired value of the attributepublic void addContent(java.lang.String content)
content - content of the elementpublic org.jdom.Document getDocument()
public java.lang.String getString(java.lang.String attributeName)
attributeName - attribute's name
public java.lang.Integer getInteger(java.lang.String attributeName)
attributeName - name of the attribute
public java.lang.Long getLong(java.lang.String attributeName)
attributeName - name of the attribute
public java.lang.Boolean getBoolean(java.lang.String attributeName)
attributeName - name of the attribute
public java.util.Date getDate(java.lang.String attributeName)
attributeName - name of the attribute
public boolean isAttributeValueNull(java.lang.String attributeName)
attributeName - name of the attribute to check
public static void setAttributesToRoot(ElementFacade facade,
java.lang.Integer merchantAccountCode,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.Object> config)
facade - facade to be used for the assignmentmerchantAccountCode - value of the merchant account codepassword - value of the passwordconfig - configuration settings to be sent to the server
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||