public final class AttributesImpl extends Object implements Attributes
Attributes
which allows attributes without values using NO_VALUE.| Modifier and Type | Field and Description |
|---|---|
private ListMap<String,String> |
name2value
Maps the name of an attribute to its value.
|
static String |
NO_VALUE
Used as a value in
name2value
to signify that the corresponding attribute has no value. |
| Constructor and Description |
|---|
AttributesImpl(ListMap<String,String> name2value)
Creates a new empty
AttributesImpl
which represents the given attribute list. |
| Modifier and Type | Method and Description |
|---|---|
int |
getIndex(String qName) |
int |
getIndex(String uri,
String localPart) |
int |
getLength() |
String |
getLocalName(int index) |
String |
getQName(int index) |
String |
getType(int index) |
String |
getType(String qName) |
String |
getType(String uri,
String localName) |
String |
getURI(int index) |
String |
getValue(int index) |
String |
getValue(String qName) |
String |
getValue(String uri,
String localName) |
private static String |
noValueToNull(Object valueOrNot)
|
AttributesImpl |
toLowerCase() |
String |
toString() |
public static final String NO_VALUE
name2value
to signify that the corresponding attribute has no value.
This is much better than simply unsing null.
The latter would not allow to rule out a multiple attribute
without a value.AttributesImpl(ListMap<String,String> name2value)
AttributesImpl
which represents the given attribute list.name2value - a ListMap representing an attribute list,
as specified for name2value.private static String noValueToNull(Object valueOrNot)
valueOrNot - a String or the object NO_VALUE.String which is
null for valueOrNot == NO_VALUE.
valueOrNot itself casted to a string otherwise.
public int getLength()
getLength in interface Attributespublic String getURI(int index)
getURI in interface Attributespublic String getLocalName(int index)
getLocalName in interface Attributespublic String getQName(int index)
getQName in interface Attributespublic String getType(int index)
getType in interface Attributespublic String getValue(int index)
getValue in interface Attributespublic int getIndex(String uri, String localPart)
getIndex in interface Attributespublic int getIndex(String qName)
getIndex in interface Attributespublic String getType(String uri, String localName)
getType in interface Attributespublic String getType(String qName)
getType in interface Attributespublic String getValue(String uri, String localName)
getValue in interface Attributespublic String getValue(String qName)
getValue in interface Attributespublic AttributesImpl toLowerCase()
Copyright © 2012–2018 Simuline Organization (l2r). All rights reserved.