org.jsxp.framework.dom
Class DefaultElement

java.lang.Object
  extended by org.jsxp.framework.dom.DefaultElement
All Implemented Interfaces:
Element, InternalElement

public class DefaultElement
extends java.lang.Object
implements InternalElement

The Class DomElement. Default implementation (DOM based) of jsxp elements.

See Also:
InternalElement

Constructor Summary
DefaultElement(ViewController sourceViewController, DefaultElement sourceParent, java.lang.String id, java.lang.String idPrefix, java.lang.String idSuffix, java.lang.String namespaceUri, java.lang.String name, java.lang.String value, boolean isText)
          Instantiates a new dom element.
 
Method Summary
 void addElement(Element e)
          Adds the element.
 void addElements(Element[] elements)
          Adds the elements.
 void addText(java.lang.String text)
          Adds the text.
 Element addXmlAsElements(java.lang.String xml)
          Adds the as elements.
 DefaultElement copy()
          Copy.
 DefaultElement copy(java.lang.String idPrefix, java.lang.String idSuffix)
          Copy.
 void exchange(Element e)
          Exchange.
 void exchange(Element[] elements)
          Exchange.
 DefaultElement findElementById(java.lang.String id)
          Find element by id.
 DefaultElement findElementByName(java.lang.String name, java.lang.String namespaceURI)
          Find element by name.
 java.lang.String getAttribute(java.lang.String key)
          Gets the attribute.
 java.lang.String getAttribute(java.lang.String namespace, java.lang.String key)
          Gets the attribute.
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Gets the attributes.
 Element[] getElements()
          Gets the elements.
 java.lang.String getId()
          Gets the id.
 java.lang.String getIdPrefix()
          Gets the id prefix.
 java.lang.String getIdSuffix()
          Gets the id suffix.
 java.lang.String getName()
          Gets the name.
 java.lang.String getNamespaceURI()
          Gets the namespace uri.
 Element getParent()
          Gets the parent.
 ViewController getSourceViewController()
          Gets the source view controller.
 java.lang.String getValue()
          Gets the value.
 java.lang.String getVariableValue(java.lang.String key)
          Gets the variable value.
 boolean hasAttribute(java.lang.String key)
          Checks for attribute.
 boolean hasAttribute(java.lang.String namespace, java.lang.String key)
          Checks for attribute.
 boolean isText()
          Checks if is text.
 void remove()
          Removes the.
 void removeAttribute(java.lang.String name)
          Removes the attribute.
 void removeAttribute(java.lang.String namespace, java.lang.String name)
          Removes the attribute.
 void removeElement(Element e)
          Removes the element.
 void removeElements()
          Removes the elements.
 void setAttribute(java.lang.String key, java.lang.String value)
          Sets the attribute.
 void setAttribute(java.lang.String namespace, java.lang.String key, java.lang.String value)
          Sets the attribute.
 void setValue(java.lang.String value)
          Sets the value.
 void setValues(java.lang.String[] values)
          Sets the values.
 void setVariable(java.lang.String name, java.lang.String value)
          Sets the variable.
 void setVariablesWithBean(java.lang.Object parameterBean)
          Fill variables.
 void substituteVariables()
          Substitute variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultElement

public DefaultElement(ViewController sourceViewController,
                      DefaultElement sourceParent,
                      java.lang.String id,
                      java.lang.String idPrefix,
                      java.lang.String idSuffix,
                      java.lang.String namespaceUri,
                      java.lang.String name,
                      java.lang.String value,
                      boolean isText)
Instantiates a new dom element.

Parameters:
sourceViewController -
sourceParent -
id -
idPrefix -
namespaceUri -
name -
value -
Method Detail

addElement

public void addElement(Element e)
Description copied from interface: Element
Adds the element.

Specified by:
addElement in interface Element
Parameters:
e - the e

addElements

public void addElements(Element[] elements)
Description copied from interface: Element
Adds the elements.

Specified by:
addElements in interface Element
Parameters:
elements - the elements

addText

public void addText(java.lang.String text)
Description copied from interface: Element
Adds the text.

Specified by:
addText in interface Element
Parameters:
text - the text

addXmlAsElements

public Element addXmlAsElements(java.lang.String xml)
Description copied from interface: Element
Adds the as elements.

Specified by:
addXmlAsElements in interface Element
Parameters:
xml - the xml
Returns:
the element

copy

public DefaultElement copy()
Description copied from interface: Element
Copy.

Specified by:
copy in interface Element
Returns:
the element

copy

public DefaultElement copy(java.lang.String idPrefix,
                           java.lang.String idSuffix)
Description copied from interface: Element
Copy.

Specified by:
copy in interface Element
Parameters:
idPrefix - the id prefix
idSuffix - the id suffix
Returns:
the element

exchange

public void exchange(Element e)
Description copied from interface: Element
Exchange.

Specified by:
exchange in interface Element
Parameters:
e - the e

exchange

public void exchange(Element[] elements)
Description copied from interface: Element
Exchange.

Specified by:
exchange in interface Element
Parameters:
elements - the elements

findElementById

public DefaultElement findElementById(java.lang.String id)
Description copied from interface: Element
Find element by id.

Specified by:
findElementById in interface Element
Parameters:
id - the id
Returns:
the element

findElementByName

public DefaultElement findElementByName(java.lang.String name,
                                        java.lang.String namespaceURI)
Description copied from interface: Element
Find element by name.

Specified by:
findElementByName in interface Element
Parameters:
name - the name
namespaceURI - the namespace uri
Returns:
the element

getAttribute

public java.lang.String getAttribute(java.lang.String key)
Description copied from interface: Element
Gets the attribute.

Specified by:
getAttribute in interface Element
Parameters:
key - the key
Returns:
the attribute

getAttribute

public java.lang.String getAttribute(java.lang.String namespace,
                                     java.lang.String key)
Description copied from interface: Element
Gets the attribute.

Specified by:
getAttribute in interface Element
Parameters:
namespace - the namespace
key - the key
Returns:
the attribute

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Description copied from interface: Element
Gets the attributes.

Specified by:
getAttributes in interface Element
Returns:
the attributes

getElements

public Element[] getElements()
Description copied from interface: Element
Gets the elements.

Specified by:
getElements in interface Element
Returns:
the elements

getId

public java.lang.String getId()
Description copied from interface: Element
Gets the id.

Specified by:
getId in interface Element
Returns:
the id

getIdPrefix

public java.lang.String getIdPrefix()
Description copied from interface: Element
Gets the id prefix.

Specified by:
getIdPrefix in interface Element
Returns:
the id prefix

getIdSuffix

public java.lang.String getIdSuffix()
Description copied from interface: Element
Gets the id suffix.

Specified by:
getIdSuffix in interface Element
Returns:
the id suffix

getName

public java.lang.String getName()
Description copied from interface: Element
Gets the name.

Specified by:
getName in interface Element
Returns:
the name

getNamespaceURI

public java.lang.String getNamespaceURI()
Description copied from interface: Element
Gets the namespace uri.

Specified by:
getNamespaceURI in interface Element
Returns:
the namespace uri

getParent

public Element getParent()
Description copied from interface: Element
Gets the parent.

Specified by:
getParent in interface Element
Returns:
the parent

getSourceViewController

public ViewController getSourceViewController()
Description copied from interface: Element
Gets the source view controller.

Specified by:
getSourceViewController in interface Element
Returns:
the source view controller

getValue

public java.lang.String getValue()
Description copied from interface: Element
Gets the value.

Specified by:
getValue in interface Element
Returns:
the value

getVariableValue

public java.lang.String getVariableValue(java.lang.String key)
Description copied from interface: InternalElement
Gets the variable value.

Specified by:
getVariableValue in interface InternalElement
Parameters:
key - the key
Returns:
the variable value

hasAttribute

public boolean hasAttribute(java.lang.String key)
Description copied from interface: Element
Checks for attribute.

Specified by:
hasAttribute in interface Element
Parameters:
key - the key
Returns:
true, if successful

hasAttribute

public boolean hasAttribute(java.lang.String namespace,
                            java.lang.String key)
Description copied from interface: Element
Checks for attribute.

Specified by:
hasAttribute in interface Element
Parameters:
namespace - the namespace
key - the key
Returns:
true, if successful

isText

public boolean isText()
Description copied from interface: Element
Checks if is text.

Specified by:
isText in interface Element
Returns:
true, if is text

remove

public void remove()
Description copied from interface: Element
Removes the.

Specified by:
remove in interface Element

removeAttribute

public void removeAttribute(java.lang.String name)
Description copied from interface: Element
Removes the attribute.

Specified by:
removeAttribute in interface Element
Parameters:
name - the name

removeAttribute

public void removeAttribute(java.lang.String namespace,
                            java.lang.String name)
Description copied from interface: Element
Removes the attribute.

Specified by:
removeAttribute in interface Element
Parameters:
namespace - the namespace
name - the name

removeElement

public void removeElement(Element e)
Description copied from interface: Element
Removes the element.

Specified by:
removeElement in interface Element
Parameters:
e - the e

removeElements

public void removeElements()
Description copied from interface: Element
Removes the elements.

Specified by:
removeElements in interface Element

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.String value)
Description copied from interface: Element
Sets the attribute.

Specified by:
setAttribute in interface Element
Parameters:
key - the key
value - the value

setAttribute

public void setAttribute(java.lang.String namespace,
                         java.lang.String key,
                         java.lang.String value)
Description copied from interface: Element
Sets the attribute.

Specified by:
setAttribute in interface Element
Parameters:
namespace - the namespace
key - the key
value - the value

setValue

public void setValue(java.lang.String value)
Description copied from interface: Element
Sets the value.

Specified by:
setValue in interface Element
Parameters:
value - the new value

setValues

public void setValues(java.lang.String[] values)
Description copied from interface: Element
Sets the values.

Specified by:
setValues in interface Element
Parameters:
values - the new values

setVariable

public void setVariable(java.lang.String name,
                        java.lang.String value)
Description copied from interface: Element
Sets the variable.

Specified by:
setVariable in interface Element
Parameters:
name - the name
value - the value

setVariablesWithBean

public void setVariablesWithBean(java.lang.Object parameterBean)
Description copied from interface: Element
Fill variables. Use a bean to match get/setter of the bean and the element-variables to fill the variables with values.

Specified by:
setVariablesWithBean in interface Element
Parameters:
parameterBean - the bean used to fill the variables of an element

substituteVariables

public void substituteVariables()
Description copied from interface: InternalElement
Substitute variables. A method call will trigger the variable substitution for the implementing element.

Specified by:
substituteVariables in interface InternalElement


Copyright © 2012 Oliver Szymanski & David Tanzer