Class ObjectNameEncoderAccessor.DefaultObjectNameEncoder

java.lang.Object
com.caplin.management.jmx.encoder.ObjectNameEncoderAccessor.DefaultObjectNameEncoder
All Implemented Interfaces:
ObjectNameEncoder
Enclosing class:
ObjectNameEncoderAccessor

public static class ObjectNameEncoderAccessor.DefaultObjectNameEncoder extends 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\?"