Arch4J 1.1

org.arch4j.generator
Class GeneratorUtility

java.lang.Object
  |
  +--org.arch4j.generator.GeneratorUtility

public class GeneratorUtility
extends Object

This class contains utility helper methods used by the code generators.

Version:
1.0
Author:
Ross E. Greinke

Method Summary
static String capitalizeVariableName(String variableName)
          Capitalize the given variable name.
static String convertPackageToPath(String packageName)
          Convert the package name to a relative path name that can be used to create a file.
static List convertStringListToTypeList(List stringList)
          Convert a list (possibly) containing String objects to a list containing JavaType objects.
static String convertVariableToParameter(String variableName)
          Convert the variable name to a name that can be used as a formal parameter name.
static int countLines(String multiLineText)
          Return the number of lines in the given multi-line text string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

capitalizeVariableName

public static String capitalizeVariableName(String variableName)
Capitalize the given variable name. If the variable name is null or has zero length, the unmodified variable name is returned.

Parameters:
variableName - The variable name to capitalize.
Returns:
The capitalized variable name.

convertVariableToParameter

public static String convertVariableToParameter(String variableName)
Convert the variable name to a name that can be used as a formal parameter name. The variable name is capitalized, then a or an is prepended to the name (depending on whether the variable name begins with a vowel or not).

Parameters:
variableName - The variable name to convert.
Returns:
The converted variable name.

convertPackageToPath

public static String convertPackageToPath(String packageName)
Convert the package name to a relative path name that can be used to create a file. The System property file.separator is used.

Parameters:
packageName - The package name to convert.
Returns:
The converted path name.

convertStringListToTypeList

public static List convertStringListToTypeList(List stringList)
Convert a list (possibly) containing String objects to a list containing JavaType objects.

Parameters:
stringList - The list of strings.
Returns:
The list of JavaType objects.

countLines

public static int countLines(String multiLineText)
Return the number of lines in the given multi-line text string. The System property line.separator is used to distinguish lines. Basically, answer how many tokens are available if the string where to be tokenized with a StringTokenizer.

Parameters:
multiLineText - The text string to parse.
Returns:
The number of lines.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.