org.apache.commons.betwixt.strategy
Class DecapitalizeNameMapper

java.lang.Object
  extended by org.apache.commons.betwixt.strategy.DecapitalizeNameMapper
All Implemented Interfaces:
NameMapper

public class DecapitalizeNameMapper
extends java.lang.Object
implements NameMapper

A name mapper which converts types to a decapitalized String.

This conversion decapitalizes in the standard java beans way (as per java.beans.Introspector). This means that the first letter only will be decapitalized except for the case where the first and second characters are both upper case. When both are upper case, then the name will be left alown.

So a bean type of Foo will be converted to the element name "foo"FooBar will be converted to "fooBar". But URL will remain as "URL".

Version:
$Revision: 471234 $
Author:
James Strachan

Constructor Summary
DecapitalizeNameMapper()
           
 
Method Summary
 java.lang.String mapTypeToElementName(java.lang.String typeName)
          Decapitalize first letter unless both are upper case.
 java.lang.String toString()
          Outputs a brief description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DecapitalizeNameMapper

public DecapitalizeNameMapper()
Method Detail

mapTypeToElementName

public java.lang.String mapTypeToElementName(java.lang.String typeName)
Decapitalize first letter unless both are upper case. (As per standard java beans behaviour.)

Specified by:
mapTypeToElementName in interface NameMapper
Parameters:
typeName - the string to convert
Returns:
decapitalized name as per java.beans.Introspector

toString

public java.lang.String toString()
Outputs a brief description.

Overrides:
toString in class java.lang.Object
Since:
0.8


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.