de.goerntkai.scot.app.document
Class SimpleComponent

java.lang.Object
  extended byde.goerntkai.scot.app.document.SimpleComponent
All Implemented Interfaces:
ISCoTComponent

public class SimpleComponent
extends java.lang.Object
implements ISCoTComponent

Represents a HTML element that may contain attributes as well as a text content.

Author:
Kai Görnt

Constructor Summary
SimpleComponent(java.lang.String tagName)
          This constructor stores the name of the HTML tag.
SimpleComponent(java.lang.String tagName, java.lang.String aContent)
          This constructor stores the name of the HTML tag.
 
Method Summary
 void setAttribute(java.lang.String aName, java.lang.String value)
          Sets an attribute of a given name to the given value.
 org.w3c.dom.Node toHTML(org.w3c.dom.Document doc)
          Returns the HTML representation of the element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleComponent

public SimpleComponent(java.lang.String tagName)
This constructor stores the name of the HTML tag.

Parameters:
tagName - the name of the element

SimpleComponent

public SimpleComponent(java.lang.String tagName,
                       java.lang.String aContent)
This constructor stores the name of the HTML tag.

Parameters:
tagName - the name of the element
aContent - the content of the element
Method Detail

setAttribute

public void setAttribute(java.lang.String aName,
                         java.lang.String value)
Sets an attribute of a given name to the given value.

Parameters:
aName - the attributes name
value - the attributes value

toHTML

public org.w3c.dom.Node toHTML(org.w3c.dom.Document doc)
Returns the HTML representation of the element. Uses the parent document for creating the node.

Specified by:
toHTML in interface ISCoTComponent
Parameters:
doc - the parent document
Returns:
the HTML representation
See Also:
ISCoTComponent.toHTML(org.w3c.dom.Document)


© 2004 by Kai Görnt