public final class StringValue extends StringParseableValue<String> implements Comparable<StringValue>
StringParseableValue.Factory<AV extends AttributeValue>
SimpleValue.BaseFactory<AV extends AttributeValue>
Modifier and Type | Field and Description |
---|---|
static StringValue |
EMPTY
Empty StringValue
|
value
Constructor and Description |
---|
StringValue(String validXsdString)
Convert string argument - assumed a valid xsd:string into a String value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(StringValue o) |
boolean |
equalsIgnoreCase(StringValue other)
Same as
String.equalsIgnoreCase(String) on string attribute values |
static StringValue |
getInstance(BooleanValue value)
Converts BooleanAttributeValue to String
|
static StringValue |
parse(String val)
Convert the lexical XSD string argument into a String value, using
DatatypeConverter.parseString(String) . |
String |
printXML()
Converts the internal value (accessible via
SimpleValue.getUnderlyingValue() to a valid lexical representation for XML marshalling. |
StringValue |
toLowerCase(Locale locale)
toLowerCase
|
StringValue |
trim()
trim
|
getXmlAttributes
equals, getContent, getUnderlyingValue, hashCode, toString
public static final StringValue EMPTY
public StringValue(String validXsdString)
parse(String)
instead.validXsdString
- A string containing a valid lexical representation of xsd:stringpublic static StringValue parse(String val) throws IllegalArgumentException
DatatypeConverter.parseString(String)
.val
- A string containing a lexical representation of xsd:stringIllegalArgumentException
- if value
is not a valid string representation of xsd:stringpublic int compareTo(StringValue o)
compareTo
in interface Comparable<StringValue>
public boolean equalsIgnoreCase(StringValue other)
String.equalsIgnoreCase(String)
on string attribute valuesother
- other value to be compared againstpublic StringValue trim()
trim
value.trim()
String.trim()
public StringValue toLowerCase(Locale locale)
toLowerCase
locale
- Localevalue.toLowerCase(L)
String.toLowerCase(Locale)
public static StringValue getInstance(BooleanValue value)
value
- booleanpublic String printXML()
SimpleValue.getUnderlyingValue()
to a valid lexical representation for XML marshalling. Equivalent to the 'printMethod' in JAXB 'javaType' binding
customizations. Implementations of this typically call DatatypeConverter
. This method is called by SimpleValue.getContent()
and its result cached by the same method for later use.
Therefore, no need to cache the result in the implementation.printXML
in class SimpleValue<String>
Copyright © 2012–2020. All rights reserved.