com.flat502.rox.marshal
Class HyphenatedFieldNameCodec

java.lang.Object
  extended by com.flat502.rox.marshal.HyphenatedFieldNameCodec
All Implemented Interfaces:
FieldNameCodec, FieldNameDecoder, FieldNameEncoder

public class HyphenatedFieldNameCodec
extends java.lang.Object
implements FieldNameCodec


Constructor Summary
HyphenatedFieldNameCodec()
           
 
Method Summary
 java.lang.String decodeFieldName(java.lang.String name)
          Determine an Object field name from the name of an XML-RPC struct member.
 java.lang.String encodeFieldName(java.lang.String name)
          Determine the name of an XML-RPC struct member from an Object field name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HyphenatedFieldNameCodec

public HyphenatedFieldNameCodec()
Method Detail

encodeFieldName

public java.lang.String encodeFieldName(java.lang.String name)
Determine the name of an XML-RPC struct member from an Object field name.

The default implementation splits the name on uppercase characters, converts the elements in the resulting list to lowercase and joins the resulting list using the '-' character.

Specified by:
encodeFieldName in interface FieldNameCodec
Specified by:
encodeFieldName in interface FieldNameEncoder
Parameters:
name - The name of the Object field.
Returns:
The XML-RPC struct member name the associated value should be assigned to.

decodeFieldName

public java.lang.String decodeFieldName(java.lang.String name)
Determine an Object field name from the name of an XML-RPC struct member.

The default implementation splits the name on the '-' character and concatenates the elements in the resulting list after converting the first character of all but the first elements to it's uppercase equivalent. All other characters are converted to lowercase.

Specified by:
decodeFieldName in interface FieldNameCodec
Specified by:
decodeFieldName in interface FieldNameDecoder
Parameters:
name - The XML-RPC struct member name.
Returns:
The name of the field the associated value should be assigned to.