Package net.java.ao.schema
Class AbstractFieldNameConverter
java.lang.Object
net.java.ao.schema.AbstractFieldNameConverter
- All Implemented Interfaces:
FieldNameConverter
,FieldNameProcessor
- Direct Known Subclasses:
CamelCaseFieldNameConverter
,UnderscoreFieldNameConverter
public abstract class AbstractFieldNameConverter
extends Object
implements FieldNameConverter, FieldNameProcessor
An abstract implementation of
FieldNameConverter
which handles common
tasks for the name converter (i.e. relations annotations, accessor/mutator
annotations, etc). For most tasks, custom field name converters should extend
this class, rather than directly implementing FieldNameConverter
.- Author:
- Daniel Spiewak
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Default constructor implementing the default behaviour for active objects.protected
AbstractFieldNameConverter
(List<FieldNameResolver> fieldNameResolvers) -
Method Summary
Modifier and TypeMethodDescriptionabstract String
convertName
(String name) final String
Handles operations which should be common to all field name converters such as overriding of the generated field name through annotations, etc.final String
getPolyTypeName
(Method method) Documentation on thegetName(Method)
method.
-
Constructor Details
-
AbstractFieldNameConverter
protected AbstractFieldNameConverter()Default constructor implementing the default behaviour for active objects. -
AbstractFieldNameConverter
-
-
Method Details
-
getName
Handles operations which should be common to all field name converters such as overriding of the generated field name through annotations, etc. This method also handles the converting through the Java Bean method prefix convention (get/set/is), allowing the implementing class to only concern itself with converting one
String
(from the method name) into another.This method delegates the actual conversion logic to the
convertName(String)
method. There is rarely a need for subclasses to override this method.- Specified by:
getName
in interfaceFieldNameConverter
- Parameters:
method
- The method for which a field name must be generated.- Returns:
- A valid database identifier to be used as the field name representative of the method in question.
- See Also:
-
getPolyTypeName
Documentation on thegetName(Method)
method.- Specified by:
getPolyTypeName
in interfaceFieldNameConverter
- Parameters:
method
- The method for which a corresponding field name must be generated.- Returns:
- A valid database identifier to be used as the field name representative of the method in question.
- See Also:
-
convertName
- Specified by:
convertName
in interfaceFieldNameProcessor
-