nl.lxtreme.ols.util.export
Class TextElement

java.lang.Object
  extended by nl.lxtreme.ols.util.export.TextElement
All Implemented Interfaces:
Cloneable, ExportUtils.HtmlExporter.Element

public final class TextElement
extends Object
implements ExportUtils.HtmlExporter.Element

Provides a simple text-element.


Constructor Summary
TextElement(String aValue)
          Creates a new TextElement instance.
 
Method Summary
 ExportUtils.HtmlExporter.Element addAttribute(String aName, String aValue)
          Adds an attribute to this element.
 ExportUtils.HtmlExporter.Element addChild(ExportUtils.HtmlExporter.Element aChild)
          Adds a new child element to this element.
 ExportUtils.HtmlExporter.Element addChild(String aName)
          Adds a new child element to this element.
 ExportUtils.HtmlExporter.Element addContent(String... aValue)
          Adds text content to this element.
 ExportUtils.HtmlExporter.Element clone()
          Creates a deep copy of this element.
 Collection<ExportUtils.HtmlExporter.Attribute> getAttributes()
          Returns the attributes of this element.
 ExportUtils.HtmlExporter.Element getChildByName(String aName)
          Returns the first child with the given name.
 Collection<ExportUtils.HtmlExporter.Element> getChildren()
          Returns the child-elements of this element.
 String getName()
          Returns the name of this element.
 void setParent(ExportUtils.HtmlExporter.Element aParent)
           
 String toString()
           
 String toString(ExportUtils.HtmlExporter.MacroResolver aResolver)
          Returns the string representation of this HTML-element.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextElement

public TextElement(String aValue)
Creates a new TextElement instance.

Parameters:
aValue - the value of this text element, may be null.
Method Detail

addAttribute

public ExportUtils.HtmlExporter.Element addAttribute(String aName,
                                                     String aValue)
Adds an attribute to this element.

Specified by:
addAttribute in interface ExportUtils.HtmlExporter.Element
Parameters:
aName - the name of the attribute to add;
aValue - the value of the attribute to add.
Returns:
this element.

addChild

public ExportUtils.HtmlExporter.Element addChild(ExportUtils.HtmlExporter.Element aChild)
Adds a new child element to this element.

Specified by:
addChild in interface ExportUtils.HtmlExporter.Element
Parameters:
aChild - the child element to add, cannot be null.
Returns:
the added child element (which is a clone of the one given!).

addChild

public ExportUtils.HtmlExporter.Element addChild(String aName)
Adds a new child element to this element.

Specified by:
addChild in interface ExportUtils.HtmlExporter.Element
Parameters:
aName - the name of the child element to add, cannot be null.
Returns:
the added child element.

addContent

public ExportUtils.HtmlExporter.Element addContent(String... aValue)
Adds text content to this element.

Specified by:
addContent in interface ExportUtils.HtmlExporter.Element
Parameters:
aValue - the text-values to add, cannot be null.
Returns:
this element.

clone

public ExportUtils.HtmlExporter.Element clone()
Creates a deep copy of this element.

Specified by:
clone in interface ExportUtils.HtmlExporter.Element
Overrides:
clone in class Object
See Also:
Object.clone()

getAttributes

public Collection<ExportUtils.HtmlExporter.Attribute> getAttributes()
Returns the attributes of this element.

Specified by:
getAttributes in interface ExportUtils.HtmlExporter.Element
Returns:
a collection of attributes, never null.

getChildByName

public ExportUtils.HtmlExporter.Element getChildByName(String aName)
Returns the first child with the given name.

Specified by:
getChildByName in interface ExportUtils.HtmlExporter.Element
Parameters:
aName - the name of the child to get, cannot be null.
Returns:
the first child with the given name, or null if no such child was found.

getChildren

public Collection<ExportUtils.HtmlExporter.Element> getChildren()
Returns the child-elements of this element.

Specified by:
getChildren in interface ExportUtils.HtmlExporter.Element
Returns:
a collection of child-elements, never null.

getName

public String getName()
Returns the name of this element.

Specified by:
getName in interface ExportUtils.HtmlExporter.Element
Returns:
the name of this element, never null.

setParent

public void setParent(ExportUtils.HtmlExporter.Element aParent)
Parameters:
aParent - the parent to set

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

toString

public String toString(ExportUtils.HtmlExporter.MacroResolver aResolver)
Description copied from interface: ExportUtils.HtmlExporter.Element
Returns the string representation of this HTML-element.

Specified by:
toString in interface ExportUtils.HtmlExporter.Element
Parameters:
aResolver - the macro resolver to use for any found macros.
Returns:
the string representation of this element, never null.
See Also:
ExportUtils.HtmlExporter.Element.toString(nl.lxtreme.ols.util.ExportUtils.HtmlExporter.MacroResolver)


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.