org.javagen.agile.oo.naming
Class JavaNamingService

java.lang.Object
  extended by org.javagen.agile.oo.naming.JavaNamingService
All Implemented Interfaces:
OONamingService, Pluralisation

public class JavaNamingService
extends Object
implements OONamingService

Common Java naming services.

Author:
Richard Easterling

Constructor Summary
JavaNamingService()
           
 
Method Summary
 String bindName(String templateKey, Model model)
           
 String camelBackName(String anyString)
          Converts any string to language-legal camelBack name.
 String className(Class _class)
           
 String className(String classNameTemplateKey, Class _class)
           
 String collectionImplementation(String collectionKey)
          Returns a fully-qualified implementation class name given an abstract key name.
 String collectionInterface(String collectionKey)
          Returns a fully-qualified interface name given an abstract key name.
 String fullClassName(String packageNameTemplateKey, String classNameTemplateKey, Class _class)
           
 Collections getCollections()
           
 Pluralisation getPluralisation()
           
 String packageFromPath(String filePath)
          Converts a file path to a language-specific package/module path.
 String packageName(String packageNameTemplateKey, Model _class)
           
 void setCollections(Collections collections)
           
 void setPluralisation(Pluralisation pluralisation)
           
 String toPlural(String singular)
          Takes a case-sensitive name and makes it plural.
 String toSingular(String plural)
          Takes a case-sensitive name and makes it singular.
 String varFromClassName(String className)
          Creates a variable name given a class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaNamingService

public JavaNamingService()
Method Detail

varFromClassName

public String varFromClassName(String className)
Description copied from interface: OONamingService
Creates a variable name given a class name. Usualy just changes the first letter to lower case.

Specified by:
varFromClassName in interface OONamingService

packageFromPath

public String packageFromPath(String filePath)
Description copied from interface: OONamingService
Converts a file path to a language-specific package/module path.

Specified by:
packageFromPath in interface OONamingService

camelBackName

public String camelBackName(String anyString)
Description copied from interface: OONamingService
Converts any string to language-legal camelBack name.

Specified by:
camelBackName in interface OONamingService

bindName

public String bindName(String templateKey,
                       Model model)
Specified by:
bindName in interface OONamingService

className

public String className(String classNameTemplateKey,
                        Class _class)
Specified by:
className in interface OONamingService

className

public String className(Class _class)
Specified by:
className in interface OONamingService

packageName

public String packageName(String packageNameTemplateKey,
                          Model _class)
Specified by:
packageName in interface OONamingService

fullClassName

public String fullClassName(String packageNameTemplateKey,
                            String classNameTemplateKey,
                            Class _class)
Specified by:
fullClassName in interface OONamingService

collectionInterface

public String collectionInterface(String collectionKey)
Description copied from interface: OONamingService
Returns a fully-qualified interface name given an abstract key name. Common key names are: SET, LIST, MAP.

Specified by:
collectionInterface in interface OONamingService

collectionImplementation

public String collectionImplementation(String collectionKey)
Description copied from interface: OONamingService
Returns a fully-qualified implementation class name given an abstract key name. Common key names are: SET, LIST, MAP.

Specified by:
collectionImplementation in interface OONamingService

toPlural

public String toPlural(String singular)
Description copied from interface: Pluralisation
Takes a case-sensitive name and makes it plural.

Specified by:
toPlural in interface Pluralisation

toSingular

public String toSingular(String plural)
Description copied from interface: Pluralisation
Takes a case-sensitive name and makes it singular. This method preserves camel-back naming conventions generally used with class names. Thus input names may need to be converted to be recognized.

Specified by:
toSingular in interface Pluralisation

getCollections

public Collections getCollections()

setCollections

public void setCollections(Collections collections)

getPluralisation

public Pluralisation getPluralisation()

setPluralisation

public void setPluralisation(Pluralisation pluralisation)


Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.