|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.html.HtmlElement
public abstract class HtmlElement
Parent to other HTML elements.
Version Info:
$Revision: 501 $ |
$Date: 2007-04-04 09:13:28 -0600 (Wed, 04 Apr 2007) $ |
$Author: dharland $ |
Field Summary | |
---|---|
static String |
NBSP_HTML
HTML representation of a non-breaking space. |
static String |
NBSP_TEXT
Plain text representation of NBSP_HTML . |
static String |
NBSP_UNICODE
The unicode text into which java's HTML parsers convert NBSP_HTML . |
Method Summary | |
---|---|
HtmlAttribute |
addAttribute(HtmlAttribute newAttribute)
Adds newAttribute to this element. |
protected void |
copyAttributesOf(HtmlElement other)
Copies the attributes of the other element into this one. |
HtmlAttribute |
getAttribute(HTML.Attribute attributeType)
Returns the attribute of the given type held by this element, if any. |
Collection<HtmlAttribute> |
getAttributes()
Returns the attributes of this element. |
String |
getAttributeValue(HTML.Attribute attributeType)
Returns the value of the given attribute, or the empty string ("") if this element has no such attribute. |
HTML.Tag |
getTag()
Returns the HTML tag for this element. |
abstract boolean |
isSimple()
Returns true if this is a simple element. |
int |
removeAllAttributes()
Removes all attributes from this element. |
HtmlAttribute |
removeAttribute(HTML.Attribute unwantedType)
Removes from this element its attribute of the given type. |
void |
writeHtmlTo(Writer device,
int padding,
boolean newLine)
Writes this element to the given device. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NBSP_HTML
public static final String NBSP_UNICODE
NBSP_HTML
. When writing HTML elements to
HTML text, this is the value used for a non-breaking space.
This representation is ASCII 0xA0, or unicode 00A0.
public static final String NBSP_TEXT
NBSP_HTML
. When writing HTML
elements to plain (non-HTML) text, this is the value used for
a non-breaking space. This representation is the normal space
character, ASCII 32 (0x20).
Method Detail |
---|
public HTML.Tag getTag()
public abstract boolean isSimple()
public HtmlAttribute addAttribute(HtmlAttribute newAttribute)
newAttribute
to this element. If this element currently holds
an attribute of the same type as newAttribute
, it is replaced by
newAttribute
.
newAttribute
- a new attribute for this element.
If this value is null this method does nothing.
newAttribute
, or
null if this element had no attribute of that type.public HtmlAttribute removeAttribute(HTML.Attribute unwantedType)
unwantedType
- the type of attribute to remove from this element.
public int removeAllAttributes()
public HtmlAttribute getAttribute(HTML.Attribute attributeType)
attributeType
- the type of attribute desired.
public Collection<HtmlAttribute> getAttributes()
The returned collection is not held by this element, so any changes made to it will be not reflected in this object. The attributes in the collection, however, are those held by this element.
public String getAttributeValue(HTML.Attribute attributeType)
attributeType
- the name of an attribute of this element
for which a value is sought.
protected void copyAttributesOf(HtmlElement other)
other
- a provider of HTML attributes.public void writeHtmlTo(Writer device, int padding, boolean newLine) throws IOException
device
- the destination of the HTML.padding
- the number of spaces to write before writing this element.newLine
- if this value is true, a new-line character is
written after this element.
IOException
- if anything goes wrong while writing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |