org.mortbay.html
Class Element

java.lang.Object
  extended by org.mortbay.html.Element
Direct Known Subclasses:
Composite, DefList, Include, Tag

Deprecated. Unless somebody steps forward to update and maintain this package

public abstract class Element
extends Object

HTML Element.

This abstract class is the base for all HTML Elements. The feature of an abstract HTML Element is that it can be added to HTML Pages, HTML Composites and several other HTML Elements derivations. Elements may also have attributes set, which are handled by the derived Element.

Version:
$Id: Element.java,v 1.10 2005/08/13 00:01:23 gregwilkins Exp $
Author:
Greg Wilkins
See Also:
Page, Composite

Field Summary
static String ALIGN
          Deprecated.  
protected  Hashtable attributeMap
          Deprecated.  
static String BGCOLOR
          Deprecated.  
static String BOTTOM
          Deprecated.  
static String CENTER
          Deprecated.  
static String CLASS
          Deprecated.  
static String COLOR
          Deprecated.  
static String HEIGHT
          Deprecated.  
static String ID
          Deprecated.  
static String LEFT
          Deprecated.  
static String MIDDLE
          Deprecated.  
static String noAttributes
          Deprecated.  
static String RIGHT
          Deprecated.  
static String SIZE
          Deprecated.  
static String STYLE
          Deprecated.  
static String TOP
          Deprecated.  
static String VALIGN
          Deprecated.  
static String WIDTH
          Deprecated.  
 
Constructor Summary
Element()
          Deprecated. Default constructor.
Element(String attributes)
          Deprecated. Construct with attributes.
 
Method Summary
 Element attribute(String attributes)
          Deprecated. Add element Attributes.
 Element attribute(String attribute, long value)
          Deprecated. Add quoted element Attributes and value.
 Element attribute(String attribute, Object value)
          Deprecated. Add quoted element Attributes and value.
 String attributes()
          Deprecated.  
 Element attributes(String attributes)
          Deprecated. Use attribute(String).
 Element bgColor(String color)
          Deprecated. set BGCOLOR.
 Element bottom()
          Deprecated. Bottom align.
 Element center()
          Deprecated. Center.
 Element color(String color)
          Deprecated. set color.
 Element cssClass(String c)
          Deprecated. set CSS CLASS.
 Element cssID(String id)
          Deprecated. set CSS ID.
 int height()
          Deprecated.  
 Element height(int h)
          Deprecated. set height.
 Element height(String h)
          Deprecated. set height.
 Element left()
          Deprecated. left justify.
 Element middle()
          Deprecated. Middle align.
 Element right()
          Deprecated. right justify.
 Element setAttributesFrom(Element e)
          Deprecated. Set attributes from another Element.
 int size()
          Deprecated.  
 Element size(int s)
          Deprecated. set size.
 Element size(String s)
          Deprecated. set size.
 Element style(String style)
          Deprecated. set Style.
 Element top()
          Deprecated. Top align.
 String toString()
          Deprecated. Convert Element to String.
 int width()
          Deprecated.  
 Element width(int w)
          Deprecated. set width.
 Element width(String w)
          Deprecated. set width.
 void write(OutputStream out)
          Deprecated. Write Element to an OutputStream.
 void write(OutputStream out, String encoding)
          Deprecated. Write Element to an OutputStream.
abstract  void write(Writer out)
          Deprecated. Write element to a Writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

noAttributes

public static final String noAttributes
Deprecated. 
See Also:
Constant Field Values

ALIGN

public static final String ALIGN
Deprecated. 
See Also:
Constant Field Values

LEFT

public static final String LEFT
Deprecated. 
See Also:
Constant Field Values

RIGHT

public static final String RIGHT
Deprecated. 
See Also:
Constant Field Values

CENTER

public static final String CENTER
Deprecated. 
See Also:
Constant Field Values

VALIGN

public static final String VALIGN
Deprecated. 
See Also:
Constant Field Values

TOP

public static final String TOP
Deprecated. 
See Also:
Constant Field Values

BOTTOM

public static final String BOTTOM
Deprecated. 
See Also:
Constant Field Values

MIDDLE

public static final String MIDDLE
Deprecated. 
See Also:
Constant Field Values

WIDTH

public static final String WIDTH
Deprecated. 
See Also:
Constant Field Values

HEIGHT

public static final String HEIGHT
Deprecated. 
See Also:
Constant Field Values

SIZE

public static final String SIZE
Deprecated. 
See Also:
Constant Field Values

COLOR

public static final String COLOR
Deprecated. 
See Also:
Constant Field Values

BGCOLOR

public static final String BGCOLOR
Deprecated. 
See Also:
Constant Field Values

STYLE

public static final String STYLE
Deprecated. 
See Also:
Constant Field Values

CLASS

public static final String CLASS
Deprecated. 
See Also:
Constant Field Values

ID

public static final String ID
Deprecated. 
See Also:
Constant Field Values

attributeMap

protected Hashtable attributeMap
Deprecated. 
Constructor Detail

Element

public Element()
Deprecated. 
Default constructor.


Element

public Element(String attributes)
Deprecated. 
Construct with attributes.

Parameters:
attributes - The initial attributes of the element
Method Detail

write

public abstract void write(Writer out)
                    throws IOException
Deprecated. 
Write element to a Writer. This abstract method is called by the Page or other containing Element to write the HTML for this element. This must be implemented by the derived Element classes.

Parameters:
out - Writer to write the element to.
Throws:
IOException

write

public void write(OutputStream out)
           throws IOException
Deprecated. 
Write Element to an OutputStream. Calls print(Writer) and checks errors Elements that override this method should also override write(Writer) to avoid infinite recursion.

Parameters:
out - OutputStream to write the element to.
Throws:
IOException

write

public void write(OutputStream out,
                  String encoding)
           throws IOException
Deprecated. 
Write Element to an OutputStream. Calls print(Writer) and checks errors Elements that override this method should also override write(Writer) to avoid infinite recursion.

Parameters:
out - OutputStream to write the element to.
Throws:
IOException

attributes

public String attributes()
Deprecated. 

attributes

public Element attributes(String attributes)
Deprecated. Use attribute(String).

Add element Attributes. The attributes are added to the Element attributes (separated with a space). The attributes are available to the derived class in the protected member String attributes

Parameters:
attributes - String of HTML attributes to add to the element.
Returns:
This Element so calls can be chained.

setAttributesFrom

public Element setAttributesFrom(Element e)
Deprecated. 
Set attributes from another Element.

Parameters:
e - Element
Returns:
This Element

attribute

public Element attribute(String attributes)
Deprecated. 
Add element Attributes. The attributes are added to the Element attributes (separated with a space). The attributes are available to the derived class in the protected member String attributes

Parameters:
attributes - String of HTML attributes to add to the element. A null attribute clears the current attributes.
Returns:
This Element so calls can be chained.

attribute

public Element attribute(String attribute,
                         Object value)
Deprecated. 
Add quoted element Attributes and value.

Parameters:
attribute - String of HTML attribute tag
value - String value of the attribute to be quoted
Returns:
This Element so calls can be chained.

attribute

public Element attribute(String attribute,
                         long value)
Deprecated. 
Add quoted element Attributes and value.

Parameters:
attribute - String of HTML attribute tag
value - String value of the attribute to be quoted
Returns:
This Element so calls can be chained.

toString

public String toString()
Deprecated. 
Convert Element to String. Uses write() to convert the HTML Element to a string.

Overrides:
toString in class Object
Returns:
String of the HTML element

left

public Element left()
Deprecated. 
left justify. Convenience method equivalent to attribute("align","left"). Not applicable to all Elements.


right

public Element right()
Deprecated. 
right justify. Convenience method equivalent to attribute("align","right"). Not applicable to all Elements.


center

public Element center()
Deprecated. 
Center. Convenience method equivalent to attribute("align","center"). Not applicable to all Elements.


top

public Element top()
Deprecated. 
Top align. Convenience method equivalent to attribute("valign","top"). Not applicable to all Elements.


bottom

public Element bottom()
Deprecated. 
Bottom align. Convenience method equivalent to attribute("valign","bottom"). Not applicable to all Elements.


middle

public Element middle()
Deprecated. 
Middle align. Convenience method equivalent to attribute("valign","middle"). Not applicable to all Elements.


width

public Element width(int w)
Deprecated. 
set width. Convenience method equivalent to attribute("width",w). Not applicable to all Elements.


width

public Element width(String w)
Deprecated. 
set width. Convenience method equivalent to attribute("width",w). Not applicable to all Elements.


width

public int width()
Deprecated. 

height

public Element height(int h)
Deprecated. 
set height. Convenience method equivalent to attribute("height",h). Not applicable to all Elements.


height

public Element height(String h)
Deprecated. 
set height. Convenience method equivalent to attribute("height",h). Not applicable to all Elements.


height

public int height()
Deprecated. 

size

public Element size(int s)
Deprecated. 
set size. Convenience method equivalent to attribute("size",s). Not applicable to all Elements.


size

public Element size(String s)
Deprecated. 
set size. Convenience method equivalent to attribute("size",s). Not applicable to all Elements.


size

public int size()
Deprecated. 

color

public Element color(String color)
Deprecated. 
set color. Convenience method equivalent to attribute("color",color). Not applicable to all Elements.


bgColor

public Element bgColor(String color)
Deprecated. 
set BGCOLOR. Convenience method equivalent to attribute("bgcolor",color). Not applicable to all Elements.


cssClass

public Element cssClass(String c)
Deprecated. 
set CSS CLASS.


cssID

public Element cssID(String id)
Deprecated. 
set CSS ID. Convenience method equivalent to attribute("id",id).


style

public Element style(String style)
Deprecated. 
set Style. Convenience method equivalent to attribute("style",style).