public class HtmlAttribute extends Object
Constructor and Description |
---|
HtmlAttribute(HtmlAttribute sourceAttribute)
Copy constructor, constructs a new HTML attribute from the supplied sourceAttribute.
|
HtmlAttribute(String name)
Constructs this HTML attribute from the supplied name.
|
HtmlAttribute(String name,
String value)
Constructs this HTML attribute from the supplied name and value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object htmlAttribute)
Determines if the supplied htmlAttribute is equal to this HtmlAttribute.
|
String |
getName()
Gets the name of this HTML attribute.
|
String |
getValue()
Gets the value of this HTML attribute.
|
int |
hashCode()
Computes the hash code of this HtmlAttribute.
|
String |
toHtml()
Creates an HTML representation of this HTML attribute.
|
String |
toString()
Creates a String representation of this HTML attribute.
|
static void |
validateAttributeName(String name)
Validates if the supplied name is a valid HTML attribute name.
|
public HtmlAttribute(String name)
name
- The name of this HTML attribute.NullPointerException
- When the supplied name is null.IllegalArgumentException
- When the supplied name is empty or not valid.
public HtmlAttribute(String name, String value)
name
- The name of this HTML attribute.value
- The value of this HTML attribute.NullPointerException
- When the supplied name is null.IllegalArgumentException
- When the supplied name is empty or not valid.
public HtmlAttribute(HtmlAttribute sourceAttribute)
sourceAttribute
- The source to create a new HTML attribute from.public static void validateAttributeName(String name)
name
- The name of the HTML attribute to verify.NullPointerException
- When the supplied name is null.IllegalArgumentException
- When the supplied name is empty or contains an illegal character.public String getName()
public String getValue()
public String toHtml()
public int hashCode()
public boolean equals(Object htmlAttribute)
Copyright © 2008–2018. All rights reserved.