public static class ObjectNameEncoderAccessor.DefaultObjectNameEncoder extends java.lang.Object implements ObjectNameEncoder
Standard ObjectNameEncoder
that will be used if the ObjectNameEncoderAccessor.OBJECT_NAME_ENCODER_CLASS_PROPERTY_NAME
system property is not set, or if there is a problem with the specified class.
The following character will be encoded/decoded by this class:
,
:
=
"
*
?
\
With the exception of a backslash (\
), any value that contains any of the above characters will be encoded.
If a value needs to be encoded it will be places within quotes("
). Further to this, the "
, *
, ?
and \
characters will be escaped by the backslash (\
) character. Note: If a value contains a backslash character, but none of the other characters listed above, will not need to be encoded, however if it does need to be encoded, then the backslash character must be escaped.
Decoded/encoded value examples:
Decoded Value | Encoded Value |
---|---|
ABC |
ABC |
AB=C |
"AB=C" |
ABC: |
"ABC:" |
A,BC |
"A,BC" |
\ABC |
\ABC |
\ABC: |
"\\ABC:" |
AB"C" |
"AB\"C\"" |
AB*C |
"AB\*C" |
ABC? |
"ABC\?" |
Constructor and Description |
---|
ObjectNameEncoderAccessor.DefaultObjectNameEncoder() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
decodeValue(java.lang.String encodedValue)
Decodes an
ObjectName value that was encoded with the ObjectNameEncoder.encodeValue(String) method. |
java.lang.String |
encodeValue(java.lang.String value)
Encodes the specified value so that it can be included within an
ObjectName . |
public ObjectNameEncoderAccessor.DefaultObjectNameEncoder()
public java.lang.String encodeValue(java.lang.String value)
ObjectNameEncoder
Encodes the specified value so that it can be included within an ObjectName
.
encodeValue
in interface ObjectNameEncoder
value
- The value to be encoded.java.lang.IllegalArgumentException
- If the value argument is null
.public java.lang.String decodeValue(java.lang.String encodedValue)
ObjectNameEncoder
Decodes an ObjectName
value that was encoded with the ObjectNameEncoder.encodeValue(String)
method.
decodeValue
in interface ObjectNameEncoder
encodedValue
- The value to be decoded.java.lang.IllegalArgumentException
- If the encodedValue argument is null
, or if it is an invalid encoded value.Please send bug reports and comments to Caplin support