Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.mdm.index.util
Class CodeGeneratorUtil

    java.lang.Object
      com.sun.mdm.index.util.CodeGeneratorUtil

public class CodeGeneratorUtil
extends java.lang.Object

utility class for code generation. contains a variety of generic code generation utility methods

Field Summary
`static java.lang.String` | `GROVE`
`protected static java.util.Set` | `mAntlrNamesSet` ANTLR names to check names against
`protected static java.util.Set` | `mDOSDeviceNamesSet` DOS device names to check names against
`protected static java.util.Set` | `mKeywordSet` keywords to check against
`static java.lang.String` | `PKG`

Constructor Summary
`CodeGeneratorUtil()` default constructor

Method Summary
`static java.io.File` | `createPackageDir(java.io.File baseDir, java.lang.String pkgName)` Create the full package working directory.
`static java.io.File` | `createWorkingDir(java.io.File baseDir)` Create the base working directory.
`static java.lang.String` | `crossCheckKeywords(java.lang.String name)` Checks generated Java names against Java keywords.
`static java.lang.String` | `getGenPath(java.lang.String projectName)` Retrieves the generated path.
`static java.lang.String` | `makeBeanName(java.lang.String name)` Creates an appropriate Java bean name using the standard Java naming convention.
`static java.lang.String` | `makeClassName(java.lang.String name)` Creates a legal Java class name from a given string.
`static java.lang.String` | `makeJavaName(java.lang.String name)` Creates a legal Java identifier name from a given String.
`static java.lang.String` | `packageToPath(java.lang.String pkgName)` Transforms package names to directory path names.
`static java.lang.String` | `packageToUnixPath(java.lang.String pkgName)` Transforms package names to unix directory path names.
`static java.lang.String` | `pathToPackage(java.lang.String name)` Transforms path names to package names.
`static java.lang.String` | `pathToPackage(java.lang.String path, java.lang.String otdName)` Transforms path names to package names.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### GROVE

    public static final java.lang.String GROVE

See Also:
  Constant Field Values

### mAntlrNamesSet

    protected static java.util.Set mAntlrNamesSet

  ANTLR names to check names against

### mDOSDeviceNamesSet

    protected static java.util.Set mDOSDeviceNamesSet

  DOS device names to check names against

### mKeywordSet

    protected static java.util.Set mKeywordSet

  keywords to check against

### PKG

    public static final java.lang.String PKG

See Also:
  Constant Field Values

Constructor Detail

### CodeGeneratorUtil

    public CodeGeneratorUtil()

  default constructor

Method Detail

### createPackageDir

    public static java.io.File createPackageDir(java.io.File baseDir,
                                                java.lang.String pkgName)
                                         throws java.lang.Exception

  Create the full package working directory.

  Parameters:
    `baseDir` - The base working directory.
    `pkgName` - The user-defined package name.
  Returns:
    The created package directory.
  Throws:
    `java.lang.Exception` - if an error occurs during directory creation.

### createWorkingDir

    public static java.io.File createWorkingDir(java.io.File baseDir)
                                         throws java.lang.Exception

  Create the base working directory.

  Parameters:
    `baseDir` - The base working directory.
  Returns:
    The created working directory.
  Throws:
    `java.lang.Exception` - if an error occurs during directory creation.

### crossCheckKeywords

    public static java.lang.String crossCheckKeywords(java.lang.String name)

  Checks generated Java names against Java keywords.

  Parameters:
    `name` - A Java identifier name.
  Returns:
    A non-Java keyword name.

### getGenPath

    public static java.lang.String getGenPath(java.lang.String projectName)

  Retrieves the generated path.

  Parameters:
    `projectName` - The name of the project.
  Returns:
    The generated path.

### makeBeanName

    public static java.lang.String makeBeanName(java.lang.String name)

  Creates an appropriate Java bean name using the standard Java naming convention.

  Parameters:
    `name` - String to create bean name from.
  Returns:
    The Java bean name.

### makeClassName

    public static java.lang.String makeClassName(java.lang.String name)

  Creates a legal Java class name from a given string.

  Parameters:
    `name` - A generic name.
  Returns:
    A qualified Java class name.

### makeJavaName

    public static java.lang.String makeJavaName(java.lang.String name)

  Creates a legal Java identifier name from a given String.

  Parameters:
    `name` - Name to create Java name from.
  Returns:
    A qualified Java identifier name.

### packageToPath

    public static java.lang.String packageToPath(java.lang.String pkgName)

  Transforms package names to directory path names.

  Parameters:
    `pkgName` - The package name.
  Returns:
    The package path name.

### packageToUnixPath

    public static java.lang.String packageToUnixPath(java.lang.String pkgName)

  Transforms package names to unix directory path names.

  Parameters:
    `pkgName` - The package name.
  Returns:
    The package path name.

### pathToPackage

    public static java.lang.String pathToPackage(java.lang.String name)

  Transforms path names to package names.

  Parameters:
    `name` - the path name
  Returns:
    the package path name, "" is returned if name is null

### pathToPackage

    public static java.lang.String pathToPackage(java.lang.String path,
                                                 java.lang.String otdName)

  Transforms path names to package names.

  Parameters:
    `path` - The path name.
    `otdName` - OTD name.
  Returns:
    The package path name.

Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Sun Microsystems, Inc.