Spring Data MongoDB - Core

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

java.lang.Object
  extended by org.springframework.data.mongodb.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.5
Author:
Oliver Gierke

Constructor Summary
CamelCaseSplittingFieldNamingStrategy(String delimiter)
          Creates a new CamelCaseSplittingFieldNamingStrategy.
 
Method Summary
 String getFieldName(MongoPersistentProperty property)
          Returns the field name to be used for the given MongoPersistentProperty.
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(MongoPersistentProperty property)
Description copied from interface: FieldNamingStrategy
Returns the field name to be used for the given MongoPersistentProperty.

Specified by:
getFieldName in interface FieldNamingStrategy
Parameters:
property - must not be null or empty;
Returns:

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 -
Returns:

Spring Data MongoDB - Core

Copyright © 2011-2014-2014 Pivotal Software, Inc.. All Rights Reserved.