Class StringValue
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.value.SimpleValue<V>
-
- org.ow2.authzforce.core.pdp.api.value.StringParseableValue<String>
-
- org.ow2.authzforce.core.pdp.api.value.StringValue
-
- All Implemented Interfaces:
Comparable<StringValue>
,AttributeValue
,PrimitiveValue
,Value
public final class StringValue extends StringParseableValue<String> implements Comparable<StringValue>
Representation of an xs:string value. This class supports parsing xs:string values. All objects of this class are immutable and all methods of the class are thread-safe.- Version:
- $Id: $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.value.StringParseableValue
StringParseableValue.Factory<AV extends AttributeValue>
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
SimpleValue.BaseFactory<AV extends AttributeValue>
-
-
Field Summary
Fields Modifier and Type Field Description static StringValue
EMPTY
Empty StringValue-
Fields inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
value
-
-
Constructor Summary
Constructors Constructor Description StringValue(String validXsdString)
Convert string argument - assumed a valid xsd:string into a String value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(StringValue o)
boolean
equalsIgnoreCase(StringValue other)
Same asString.equalsIgnoreCase(String)
on string attribute valuesstatic StringValue
getInstance(BooleanValue value)
Converts BooleanAttributeValue to Stringstatic StringValue
parse(String val)
Convert the lexical XSD string argument into a String value, usingDatatypeConverter.parseString(String)
.String
printXML()
Converts the internal value (accessible viaSimpleValue.getUnderlyingValue()
to a valid lexical representation for XML marshalling.StringValue
toLowerCase(Locale locale)
toLowerCaseStringValue
trim()
trim-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.StringParseableValue
getXmlAttributes
-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
equals, getContent, getUnderlyingValue, hashCode, toString
-
-
-
-
Field Detail
-
EMPTY
public static final StringValue EMPTY
Empty StringValue
-
-
Constructor Detail
-
StringValue
public StringValue(String validXsdString)
Convert string argument - assumed a valid xsd:string into a String value. Use with caution as no xsd:string format validation is done here. For internal purposes only. If you need proper input validation, useparse(String)
instead.- Parameters:
validXsdString
- A string containing a valid lexical representation of xsd:string
-
-
Method Detail
-
parse
public static StringValue parse(String val) throws IllegalArgumentException
Convert the lexical XSD string argument into a String value, usingDatatypeConverter.parseString(String)
.- Parameters:
val
- A string containing a lexical representation of xsd:string- Returns:
- instance
- Throws:
IllegalArgumentException
- ifvalue
is not a valid string representation of xsd:string
-
compareTo
public int compareTo(StringValue o)
- Specified by:
compareTo
in interfaceComparable<StringValue>
-
equalsIgnoreCase
public boolean equalsIgnoreCase(StringValue other)
Same asString.equalsIgnoreCase(String)
on string attribute values- Parameters:
other
- other value to be compared against- Returns:
- true if the other attribute value is not null and it represents an equivalent String ignoring case; false otherwise
-
trim
public StringValue trim()
trim
- Returns:
- StringAttributeValue with value resulting from
value.trim()
- See Also:
String.trim()
-
toLowerCase
public StringValue toLowerCase(Locale locale)
toLowerCase
- Parameters:
locale
- Locale- Returns:
- StringAttributeValue with value resulting from
value.toLowerCase(L)
- See Also:
String.toLowerCase(Locale)
-
getInstance
public static StringValue getInstance(BooleanValue value)
Converts BooleanAttributeValue to String- Parameters:
value
- boolean- Returns:
- string equivalent ("true" or "false")
-
printXML
public String printXML()
Converts the internal value (accessible viaSimpleValue.getUnderlyingValue()
to a valid lexical representation for XML marshalling. Equivalent to the 'printMethod' in JAXB 'javaType' binding customizations. Implementations of this typically callDatatypeConverter
. This method is called bySimpleValue.getContent()
and its result cached by the same method for later use. Therefore, no need to cache the result in the implementation.- Specified by:
printXML
in classSimpleValue<String>
- Returns:
- XML-valid lexical representation.
-
-