net.trajano.twiff.renderer
Class SimpleElement

java.lang.Object
  extended by net.trajano.twiff.renderer.SimpleElement
All Implemented Interfaces:
CompositePageElement, PageElement

public class SimpleElement
extends Object
implements CompositePageElement

This is a simple element that has no components.

Author:
Archimedes Trajano

Constructor Summary
SimpleElement(String elementName)
          This is a simplified constructor used for testing.
SimpleElement(String elementName, Map<String,String> attributes)
          Constructs the element.
 
Method Summary
 void accept(PageElementVisitor visitor)
          Accepts a visitor that should visit the page data.
 void addElement(PageElement element)
          Append page data to the composite.
 Map<String,String> getAttributes()
          Returns the attributes.
 int getColumnNumber()
          Return the column number where the current page element ends.
 List<PageElement> getElements()
          Returns the sub-elements in the element.
 int getLineNumber()
          Return the line number where the current page element ends.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleElement

public SimpleElement(String elementName)
This is a simplified constructor used for testing.

Parameters:
elementName -

SimpleElement

public SimpleElement(String elementName,
                     Map<String,String> attributes)
Constructs the element.

Parameters:
elementName - element name.
attributes - attributes in the element.
Method Detail

accept

public void accept(PageElementVisitor visitor)
Accepts a visitor that should visit the page data.

Specified by:
accept in interface PageElement
Parameters:
visitor - visitor.

addElement

public void addElement(PageElement element)
Description copied from interface: CompositePageElement
Append page data to the composite.

Specified by:
addElement in interface CompositePageElement
Parameters:
element -

getAttributes

public Map<String,String> getAttributes()
Returns the attributes.

Returns:
attributes.

getElements

public List<PageElement> getElements()
Returns the sub-elements in the element.

Specified by:
getElements in interface CompositePageElement
Returns:
sub-elements.

getColumnNumber

public int getColumnNumber()
Description copied from interface: PageElement
Return the column number where the current page element ends.

Specified by:
getColumnNumber in interface PageElement
Returns:
the column number. -1 if unavailable.
See Also:
PageElement.getColumnNumber()

getLineNumber

public int getLineNumber()
Description copied from interface: PageElement
Return the line number where the current page element ends.

Specified by:
getLineNumber in interface PageElement
Returns:
the line number. -1 if unavailable.
See Also:
PageElement.getLineNumber()


Copyright © 2004-2005 trajano.net. All Rights Reserved.