planetj.html
Class HTMLAttribute

java.lang.Object
  |
  +--planetj.html.HTMLAttribute
All Implemented Interfaces:
IHTMLAttribute

public class HTMLAttribute
extends Object
implements IHTMLAttribute

This class contains convience methods that may be used to generate attribute tags on HTML elements.

Author:
PlanetJ Corporation

Field Summary
 
Fields inherited from interface planetj.html.IHTMLAttribute
ALT, BORDER, CELLPADDING, CELLSPACING, CLASS, DIR, DISABLED, HEIGHT, ID, LABEL, LANG, LINK_REL_STYLESHEET, LINK_TYPE_TEXT_CSS, MAXLENGTH, NAME, SIZE, SRC, STYLE, TITLE, VALUE, WIDTH
 
Constructor Summary
HTMLAttribute()
           
 
Method Summary
static StringBuffer appendAlt(String alt, StringBuffer html)
          Appends the given alt as the alt attribute.
static StringBuffer appendAttribute(String name, int value, StringBuffer html)
          Appends the given attribute name and value to the buffer.
static StringBuffer appendAttribute(String name, String value, StringBuffer html)
          Appends the given attribute name and value to the buffer.
static StringBuffer appendBorder(int border, StringBuffer html)
          Appends the given src as the src attribute.
static StringBuffer appendCellPadding(int padding, StringBuffer html)
          Appends the given cell padding attribute.
static StringBuffer appendCellSpacing(int spacing, StringBuffer html)
          Appends the given cell spacing attribute.
static StringBuffer appendClass(String value, StringBuffer html)
          Appends the given value as the title attribute.
static StringBuffer appendHeight(int height, StringBuffer html)
          Appends the given height as the height attribute.
static StringBuffer appendID(String value, StringBuffer html)
          Appends the given value as the title attribute.
static StringBuffer appendLabel(String label, StringBuffer html)
          Appends the given label as a label attribute.
static StringBuffer appendMaxLength(int maxlength, StringBuffer html)
          Appends the given value as the value attribute.
static StringBuffer appendName(String value, StringBuffer html)
          Appends the given value as the value attribute.
static StringBuffer appendSize(int size, StringBuffer html)
          Appends the given size as the size attribute.
static StringBuffer appendSrc(String src, StringBuffer html)
          Appends the given src as the src attribute.
static StringBuffer appendTitle(String value, StringBuffer html)
          Appends the given value as the title attribute.
static StringBuffer appendValue(String value, StringBuffer html)
          Appends the given value as the value attribute.
static StringBuffer appendWidth(int width, StringBuffer html)
          Appends the given width as the width attribute.
static String encodeSpaces(String value)
          Encodes any spaces in the value for HTTP
static String prepareValue(String value)
          Checks the given value to see if it is value to include with generated HTML code.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLAttribute

public HTMLAttribute()
Method Detail

appendAlt

public static StringBuffer appendAlt(String alt,
                                     StringBuffer html)
Appends the given alt as the alt attribute.


appendAttribute

public static StringBuffer appendAttribute(String name,
                                           int value,
                                           StringBuffer html)
Appends the given attribute name and value to the buffer. If no name is specified, the given value will be appended by itself.


appendAttribute

public static StringBuffer appendAttribute(String name,
                                           String value,
                                           StringBuffer html)
Appends the given attribute name and value to the buffer. If no name is specified, the given value will be appended by itself.


appendBorder

public static StringBuffer appendBorder(int border,
                                        StringBuffer html)
Appends the given src as the src attribute.


appendCellPadding

public static StringBuffer appendCellPadding(int padding,
                                             StringBuffer html)
Appends the given cell padding attribute.


appendCellSpacing

public static StringBuffer appendCellSpacing(int spacing,
                                             StringBuffer html)
Appends the given cell spacing attribute.


appendClass

public static StringBuffer appendClass(String value,
                                       StringBuffer html)
Appends the given value as the title attribute.


appendHeight

public static StringBuffer appendHeight(int height,
                                        StringBuffer html)
Appends the given height as the height attribute.


appendID

public static StringBuffer appendID(String value,
                                    StringBuffer html)
Appends the given value as the title attribute.


appendLabel

public static StringBuffer appendLabel(String label,
                                       StringBuffer html)
Appends the given label as a label attribute.


appendMaxLength

public static StringBuffer appendMaxLength(int maxlength,
                                           StringBuffer html)
Appends the given value as the value attribute.


appendName

public static StringBuffer appendName(String value,
                                      StringBuffer html)
Appends the given value as the value attribute.


appendSize

public static StringBuffer appendSize(int size,
                                      StringBuffer html)
Appends the given size as the size attribute.


appendSrc

public static StringBuffer appendSrc(String src,
                                     StringBuffer html)
Appends the given src as the src attribute.


appendTitle

public static StringBuffer appendTitle(String value,
                                       StringBuffer html)
Appends the given value as the title attribute.


appendValue

public static StringBuffer appendValue(String value,
                                       StringBuffer html)
Appends the given value as the value attribute.


appendWidth

public static StringBuffer appendWidth(int width,
                                       StringBuffer html)
Appends the given width as the width attribute.


encodeSpaces

public static String encodeSpaces(String value)
Encodes any spaces in the value for HTTP


prepareValue

public static String prepareValue(String value)
Checks the given value to see if it is value to include with generated HTML code. If the value contains less than, greater than, or double quotes, they are replaced with their respectived HTML escape strings.