Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.0.3 generated on February 20 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.enhance
Class ApplicationIdTool

    java.lang.Object
      |
      +--kodo.enhance.ApplicationIdTool

public class ApplicationIdTool
extends Object

Generates a class appropriate for use as an application identity class.

Constructor Summary
`ApplicationIdTool(JDOConfiguration conf, Class type)` Constructs a new ApplicationIdTool capable of generating an object id class for `type`.
`ApplicationIdTool(JDOConfiguration conf, ClassMetaData meta)` Constructs a new tool instance capable of generating an object id class for `meta`.

Method Summary
`boolean` | `generateCode()` Generates the sourcecode for the application id class; returns false if the class is invalid.
`String` | `getCode()` Return the code generated for the application id, or null if invalid class or the `generateCode()` method has not been called.
`serp.util.CodeFormat` | `getCodeFormat()` The code formatter for the generated Java code.
`File` | `getDirectory()` The directory to write source to.
`boolean` | `getIgnoreErrors()` Return false if this tool is configured to throw an exception on an attempt to generate an id class for a type that does not use application identity.
`ClassMetaData` | `getMetaData()` Return metadata for the type we are generating an application id for.
`Class` | `getType()` Return the type we are generating an application id for.
`static void` | `main(String[] args)` Usage: java kodo.enhance.ApplicationIdTool [option]* <class name | .java file | .class file | .jdo file>+
`static boolean` | `run(JDOConfiguration conf, String[] args, File dir, boolean ignoreErrors, serp.util.CodeFormat format, ClassLoader loader)` Run the tool.
`static boolean` | `run(JDOConfiguration conf, String[] args, serp.util.Options opts)` Run the application id tool with the given command-line and given configuration.
`void` | `setCodeFormat(serp.util.CodeFormat format)` Set the code formatter for the generated Java code.
`void` | `setDirectory(File dir)` The directory to write source to.
`void` | `setIgnoreErrors(boolean ignore)` Set to false if this tool should throw an exception on an attempt to generate an id class for a type that does not use application identity.
`void` | `writeCode()` Writes the generated code to the proper file.

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

Constructor Detail

### ApplicationIdTool

    public ApplicationIdTool(JDOConfiguration conf,
                             Class type)

  Constructs a new ApplicationIdTool capable of generating an object id class for `type`.

### ApplicationIdTool

    public ApplicationIdTool(JDOConfiguration conf,
                             ClassMetaData meta)

  Constructs a new tool instance capable of generating an object id class for `meta`.

Method Detail

### getIgnoreErrors

    public boolean getIgnoreErrors()

  Return false if this tool is configured to throw an exception on an attempt to generate an id class for a type that does not use application identity.

### setIgnoreErrors

    public void setIgnoreErrors(boolean ignore)

  Set to false if this tool should throw an exception on an attempt to generate an id class for a type that does not use application identity.

### getCodeFormat

    public serp.util.CodeFormat getCodeFormat()

  The code formatter for the generated Java code.

### setCodeFormat

    public void setCodeFormat(serp.util.CodeFormat format)

  Set the code formatter for the generated Java code.

### getDirectory

    public File getDirectory()

  The directory to write source to. Defaults to the directory of the Java file for the set type. If the given directory does not match the package of the object id, the package structure will be created below the directory.

### setDirectory

    public void setDirectory(File dir)

  The directory to write source to. Defaults to the directory of the Java file for the set type. If the given directory does not match the package of the object id, the package structure will be created below the directory.

### getType

    public Class getType()

  Return the type we are generating an application id for.

### getMetaData

    public ClassMetaData getMetaData()

  Return metadata for the type we are generating an application id for.

### getCode

    public String getCode()

  Return the code generated for the application id, or null if invalid class or the `generateCode()` method has not been called.

### generateCode

    public boolean generateCode()
                         throws IOException

  Generates the sourcecode for the application id class; returns false if the class is invalid.

### writeCode

    public void writeCode()
                   throws IOException

  Writes the generated code to the proper file.

### main

    public static void main(String[] args)
                     throws IOException

  Usage: java kodo.enhance.ApplicationIdTool [option]* <class name | .java file | .class file | .jdo file>+

  Where the following options are recognized.

  - -properties/-p <properties file>: The path to a Kodo properties file containing information such as the license key, as outlined in `Configuration`; optional.
  - -<property name> <property value>: All bean properties of the standard Kodo `JDOConfiguration` can be set by using their names and supplying a value; for example: `-licenseKey adslfja83r3lkadf`
  - -directory/-d <output directory>: Path to the base source directory. The package structure will be created beneath this directory if necessary. If not specified, the tool will try to locate the .java file in the CLASSPATH and output to the same directory; failing that, it will use the current directory as the base directory.
  - -ignoreErrors/-i <true|false>: If false, an exception will be thrown if the tool encounters any class that does not use application identity or uses the identity class of its superclass; defaults to true.
  - -codeFormat/-cf.<property name> < property value> : Arguments like this will be used to configure the bean properties of the internal `CodeFormat`.

  Each additional argument can be either the full class name of the type to create an id class for, the path to the .java file for the type, the path to the .class file for the type, or the path to a .jdo file listing one or more types. If a .java file already exists for an application id, it will be backed up to a file named <orig file name>~.

### run

    public static boolean run(JDOConfiguration conf,
                              String[] args,
                              serp.util.Options opts)
                       throws IOException

  Run the application id tool with the given command-line and given configuration. Returns false if invalid options were given.

### run

    public static boolean run(JDOConfiguration conf,
                              String[] args,
                              File dir,
                              boolean ignoreErrors,
                              serp.util.CodeFormat format,
                              ClassLoader loader)
                       throws IOException

  Run the tool. Returns false if invalid options were given.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.0.3 generated on February 20 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.