|
SimpleServlets v5.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.simpleservlets.htmlobjects.HTMLAttribute
public final class HTMLAttribute
Immutable objects which hold a string-based name and a string-based value. Since instances are immutable, they can be safely shared.
| Field Summary | |
|---|---|
static HTMLAttribute[] |
ZERO_LEN_ARRAY
|
| Constructor Summary | |
|---|---|
HTMLAttribute(String name)
Creates an attribute defaulting the value to be the same as the name. |
|
HTMLAttribute(String name,
double value)
Creates an attribute with the specified name and value. |
|
HTMLAttribute(String name,
int value)
Creates an attribute with the specified name and value. |
|
HTMLAttribute(String name,
Object value)
Creates an attribute with the specified name and value. |
|
HTMLAttribute(String name,
String value)
Creates an attribute with the specified name and value. |
|
HTMLAttribute(String name,
Value value)
Creates an attribute with the specified name and value. |
|
| Method Summary | |
|---|---|
static HTMLAttribute |
createUnparsed(String name,
Object value)
Creates an attribute with the specified name and value. |
static HTMLAttribute |
createUnparsed(String name,
String value)
Creates an attribute with the specified name and value. |
static HTMLAttribute |
createUnparsed(String name,
Value value)
Creates an attribute with the specified name and value. |
String |
getName()
Returns the name of the attribute (never null and never blank). |
String |
getValue()
Returns the value of the attribute (never null, might be blank). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final HTMLAttribute[] ZERO_LEN_ARRAY
| Constructor Detail |
|---|
public HTMLAttribute(String name,
String value)
throws IllegalArgumentException
HTMLUtil.processMarkupEntities(String)).
name - the name of the attribute and it must not be null and must
not be empty.value - the value of the attribute and it must not be null.
IllegalArgumentException - if name or value is null, or if
name is nothing but whitespace.
public HTMLAttribute(String name,
Value value)
throws IllegalArgumentException
HTMLUtil.processMarkupEntities(String)).
The value also has any leading and trailing whitespace trimmed.
name - the name of the attribute and it must not be null and must
not be empty.value - the value of the attribute and it must not be null.
IllegalArgumentException - if name or value is null, or if
name is nothing but whitespace.
public HTMLAttribute(String name,
Object value)
throws IllegalArgumentException
HTMLUtil.processMarkupEntities(String)).
name - the name of the attribute and it must not be null and must
not be empty.value - the value of the attribute and it must not be null.
IllegalArgumentException - if name or value is null, or if
name is nothing but whitespace.
public HTMLAttribute(String name,
int value)
throws IllegalArgumentException
name - the name of the attribute and it must not be null and must
not be empty.value - the value of the attribute
IllegalArgumentException - if name is null, or if
name is nothing but whitespace.
public HTMLAttribute(String name,
double value)
throws IllegalArgumentException
name - the name of the attribute and it must not be null and must
not be empty.value - the value of the attribute
IllegalArgumentException - if name is null, or if
name is nothing but whitespace.
public HTMLAttribute(String name)
throws IllegalArgumentException
name - the name of the attribute and it must not be null and must
not be empty.
IllegalArgumentException - if name is null, or if
name is nothing but whitespace.| Method Detail |
|---|
public static HTMLAttribute createUnparsed(String name,
String value)
throws IllegalArgumentException
name - the name of the attribute and it must not be null and must
not be empty.value - the value of the attribute and it must not be null.
IllegalArgumentException - if name or value is null, or if
name is nothing but whitespace.
public static HTMLAttribute createUnparsed(String name,
Value value)
throws IllegalArgumentException
name - the name of the attribute and it must not be null and must
not be empty.value - the value of the attribute and it must not be null.
IllegalArgumentException - if name or value is null, or if
name is nothing but whitespace.
public static HTMLAttribute createUnparsed(String name,
Object value)
throws IllegalArgumentException
name - the name of the attribute and it must not be null and must
not be empty.value - the value of the attribute and it must not be null.
IllegalArgumentException - if name or value is null, or if
name is nothing but whitespace.public String getName()
public String getValue()
|
SimpleServlets v5.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||