Methods Summary |
---|
java.lang.String | capitalize(java.lang.String value)Convenience method used to capitalize a one-off attribute value before it
is returned. For example, the align values "LEFT" and "left" will both
return as "Left".
char[] chars;
int i;
// Convert string to charactares. Convert the first one to upper case,
// the other characters to lower case, and return the converted string.
chars = value.toCharArray();
if ( chars.length > 0 ) {
chars[ 0 ] = Character.toUpperCase( chars[ 0 ] );
for ( i = 1 ; i < chars.length ; ++i ) {
chars[ i ] = Character.toLowerCase( chars[ i ] );
}
return String.valueOf( chars );
}
return value;
|
public java.lang.String | getAttribute(java.lang.String attrName)
return super.getAttribute( attrName.toLowerCase(Locale.ENGLISH) );
|
public java.lang.String | getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
if ( namespaceURI != null && namespaceURI.length() > 0 ) {
return super.getAttributeNS( namespaceURI, localName );
}
return super.getAttribute( localName.toLowerCase(Locale.ENGLISH) );
|
public org.w3c.dom.Attr | getAttributeNode(java.lang.String attrName)
return super.getAttributeNode( attrName.toLowerCase(Locale.ENGLISH) );
|
public org.w3c.dom.Attr | getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
if ( namespaceURI != null && namespaceURI.length() > 0 ) {
return super.getAttributeNodeNS( namespaceURI, localName );
}
return super.getAttributeNode( localName.toLowerCase(Locale.ENGLISH) );
|
boolean | getBinary(java.lang.String name)Convenience method used to translate an attribute value into a boolean
value. If the attribute has an associated value (even an empty string),
it is set and true is returned. If the attribute does not exist, false
is returend.
return ( getAttributeNode( name ) != null );
|
java.lang.String | getCapitalized(java.lang.String name)Convenience method used to capitalize a one-off attribute value before it
is returned. For example, the align values "LEFT" and "left" will both
return as "Left".
String value;
char[] chars;
int i;
value = getAttribute( name );
if ( value != null ) {
// Convert string to charactares. Convert the first one to upper case,
// the other characters to lower case, and return the converted string.
chars = value.toCharArray();
if ( chars.length > 0 ) {
chars[ 0 ] = Character.toUpperCase( chars[ 0 ] );
for ( i = 1 ; i < chars.length ; ++i ) {
chars[ i ] = Character.toLowerCase( chars[ i ] );
}
return String.valueOf( chars );
}
}
return value;
|
public java.lang.String | getClassName()
return getAttribute( "class" );
|
public java.lang.String | getDir()
return getAttribute( "dir" );
|
public final org.w3c.dom.NodeList | getElementsByTagName(java.lang.String tagName)
return super.getElementsByTagName( tagName.toUpperCase(Locale.ENGLISH) );
|
public final org.w3c.dom.NodeList | getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
if ( namespaceURI != null && namespaceURI.length() > 0 ) {
return super.getElementsByTagNameNS( namespaceURI, localName.toUpperCase(Locale.ENGLISH) );
}
return super.getElementsByTagName( localName.toUpperCase(Locale.ENGLISH) );
|
public org.w3c.dom.html.HTMLFormElement | getForm()Convenience method returns the form in which this form element is contained.
This method is exposed for form elements through the DOM API, but other
elements have no access to it through the API.
Node parent = getParentNode();
while ( parent != null ) {
if ( parent instanceof HTMLFormElement ) {
return (HTMLFormElement) parent;
}
parent = parent.getParentNode();
}
return null;
|
public java.lang.String | getId()
return getAttribute( "id" );
|
int | getInteger(java.lang.String value)Convenience method used to translate an attribute value into an integer
value. Returns the integer value or zero if the attribute is not a
valid numeric string.
try {
return Integer.parseInt( value );
}
catch ( NumberFormatException except ) {
return 0;
}
|
public java.lang.String | getLang()
return getAttribute( "lang" );
|
public java.lang.String | getTitle()
return getAttribute( "title" );
|
void | setAttribute(java.lang.String name, boolean value)Convenience method used to set a boolean attribute. If the value is true,
the attribute is set to an empty string. If the value is false, the attribute
is removed. HTML 4.0 understands empty strings as set attributes.
if ( value ) {
setAttribute( name, name );
}
else {
removeAttribute( name );
}
|
public void | setClassName(java.lang.String className)
setAttribute( "class", className );
|
public void | setDir(java.lang.String dir)
setAttribute( "dir", dir );
|
public void | setId(java.lang.String id)
setAttribute( "id", id );
|
public void | setLang(java.lang.String lang)
setAttribute( "lang", lang );
|
public void | setTitle(java.lang.String title)
setAttribute( "title", title );
|