Spring Data Couchbase

org.springframework.data.couchbase.core.mapping
Class CamelCaseSplittingFieldNamingStrategy

java.lang.Object
  extended by org.springframework.data.couchbase.core.mapping.CamelCaseSplittingFieldNamingStrategy
All Implemented Interfaces:
FieldNamingStrategy
Direct Known Subclasses:
CamelCaseAbbreviatingFieldNamingStrategy, SnakeCaseFieldNamingStrategy

public class CamelCaseSplittingFieldNamingStrategy
extends Object
implements FieldNamingStrategy

Configurable FieldNamingStrategy that splits up camel-case property names and reconcatenates them using a configured delimiter. Individual parts of the name can be manipulated using preparePart(String).

Since:
1.1
Author:
Oliver Gierke, Michael Nitschinger

Constructor Summary
CamelCaseSplittingFieldNamingStrategy(String delimiter)
          Creates a new CamelCaseSplittingFieldNamingStrategy.
 
Method Summary
 String getFieldName(CouchbasePersistentProperty property)
          Returns the field name to be used for the given CouchbasePersistentProperty.
protected  String preparePart(String part)
          Callback to prepare the uncapitalized part obtained from the split up of the camel case source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CamelCaseSplittingFieldNamingStrategy

public CamelCaseSplittingFieldNamingStrategy(String delimiter)
Creates a new CamelCaseSplittingFieldNamingStrategy.

Parameters:
delimiter - must not be null.
Method Detail

getFieldName

public String getFieldName(CouchbasePersistentProperty property)
Description copied from interface: FieldNamingStrategy
Returns the field name to be used for the given CouchbasePersistentProperty.

Specified by:
getFieldName in interface FieldNamingStrategy
Parameters:
property - must not be null or empty.
Returns:
the field name to be used.

preparePart

protected String preparePart(String part)
Callback to prepare the uncapitalized part obtained from the split up of the camel case source. Default implementation returns the part as is.

Parameters:
part - the part.
Returns:
the prepared part.

Spring Data Couchbase

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.