View Javadoc

1   /*
2    * Copyright 2006 Outsource Cafe, Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the 'License')
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an 'AS IS' BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.javagen.agile.oo.naming;
17  
18  import org.javagen.agile.core.model.Model;
19  import org.javagen.agile.oo.model.Class;
20  
21  /***
22   * Defines Object-Oriented naming services needed to translate an abstract O-O model
23   * to a concrete implementation.  Many of these methods rely on a access to the context. 
24   *
25   * @author Richard Easterling
26   */
27  public interface OONamingService extends Pluralisation {
28  	
29      ///////////////////////////////////////////////////////////////////////////
30      // name binding methods using context and template-value replacement:
31      ///////////////////////////////////////////////////////////////////////////
32  
33      String bindName(String templateKey, Model model);
34  
35      String className(String classNameTemplateKey, Class _class);
36  
37      String className(Class _class);
38  
39      String packageName(String packageNameTemplateKey, Model _class);
40  
41      String fullClassName(String packageNameTemplateKey, String classNameTemplateKey, Class _class);
42  
43      ///////////////////////////////////////////////////////////////////////////
44      // convenience methods:
45      ///////////////////////////////////////////////////////////////////////////
46  
47      /***
48       * Creates a variable name given a class name.  
49       * Usualy just changes the first letter to lower case.
50       */
51  	String varFromClassName(String className);
52  	
53      /***
54       * Converts a file path to a language-specific package/module path.
55       */
56  	String packageFromPath(String filePath);
57      
58      /***
59       * Converts any string to language-legal camelBack name.
60       */
61      String camelBackName(String anyString);
62  
63      ///////////////////////////////////////////////////////////////////////////
64      // interface and implementation bindings for abstract collection types:
65      ///////////////////////////////////////////////////////////////////////////
66  
67      /***
68       * Returns a fully-qualified interface name given 
69       * an abstract key name.  Common key names are: SET, LIST, MAP.
70       */
71      String collectionInterface(String collectionKey);
72  
73      /***
74       * Returns a fully-qualified implementation class name given 
75       * an abstract key name.  Common key names are: SET, LIST, MAP.
76       */
77      String collectionImplementation(String collectionKey);
78  
79  
80  //  /*** @deprecated move/use Db2OOMapper */
81  //  String classSingular(String anyString);
82  //  
83  //    /*** @deprecated move/use Db2OOMapper */
84  //  String classPlural(String classSingular);
85  //  
86  //    /*** @deprecated move/use Db2OOMapper */
87  //  String propertySingular(String anyString);
88  //  
89  //    /*** @deprecated move/use Db2OOMapper */
90  //  String propertyPluaral(String propertySingular);
91  //  
92  //    /*** @deprecated move/use Db2OOMapper */
93  //  String constant(String anyString);
94  //  
95  //    /*** @deprecated move/use Db2OOMapper */
96  //  String enumeration(String anyString);
97  //  
98  //    /***
99  //     * @deprecated use collectionInterface and collectionImplementation instead
100 //     */
101 //  String collectionImplFromInterface(String collectionInterface);
102 //  
103 }