|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfi.iki.hsivonen.xml.AttributeUtil
public class AttributeUtil
Static utilities for working with (X)HTML5 attribute values.
| Field Summary | |
|---|---|
private static String[] |
EMPTY_STRING_ARRAY
An empty string array instance. |
private static Pattern |
INTEGER_PATTERN
The pattern for extracting an integer by skipping white space and ignoring trailing garbage. |
| Constructor Summary | |
|---|---|
private |
AttributeUtil()
Private constructor to prevent instantiation. |
| Method Summary | |
|---|---|
static int |
parseInteger(String attrVal)
Returns the integer represented by attrVal or
Integer.MIN_VALUE on error. |
static int |
parseNonNegativeInteger(String attrVal)
Returns the non-negative integer represented by attrVal or -1 on error. |
static int |
parsePositiveInteger(String attrVal)
Returns the positive integer represented by attrVal or -1 on error. |
static String[] |
split(String value)
Splits the argument on white space. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String[] EMPTY_STRING_ARRAY
private static Pattern INTEGER_PATTERN
| Constructor Detail |
|---|
private AttributeUtil()
| Method Detail |
|---|
public static int parseInteger(String attrVal)
attrVal or
Integer.MIN_VALUE on error.
attrVal - a string representing an integer attribute
value (can be null)
attrVal or
Integer.MIN_VALUE on errorpublic static int parseNonNegativeInteger(String attrVal)
attrVal or -1 on error.
attrVal - a string representing a non-negative
integer attribute value (can be null)
attrVal or
-1 on errorpublic static int parsePositiveInteger(String attrVal)
attrVal or -1 on error.
attrVal - a string representing a positive
integer attribute value (can be null)
attrVal or
-1 on errorpublic static String[] split(String value)
value - the attribute value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||