Package org.apache.torque.generator.configuration.paths

## Class Maven2ProjectPaths

- java.lang.Object
- - org.apache.torque.generator.configuration.paths.Maven2ProjectPaths

- All Implemented Interfaces:
    `ProjectPaths`
  Direct Known Subclasses:
    `Maven2DirectoryProjectPaths`, `Maven2JarProjectPaths`

      public abstract class Maven2ProjectPaths
      extends Object
      implements ProjectPaths

  Contains information of the default integration of the Torque generator into a maven 2 project.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected static String` | `CACHE_DIR` | Default cache directory.
    `protected static String` | `CONFIG_DIR` | Default configuration root directory, relative to the project root.
    `protected static String` | `DEFAULT_OUTPUT_DIR` | Default generation target directory, relative to the project root.
    `static String` | `MODIFIABLE_OUTPUT_DIR` | Default generation target directory for generated files which are modifiable by the user, relative to the project root.
    `static String` | `MODIFIABLE_OUTPUT_DIR_KEY` | Key for the target directory for generated files which are modifiable by the user, relative to the project root.
    `protected static String` | `SOURCE_DIR` | Default generation source file directory, relative to the configuration root directory.
    `protected static String` | `WORK_DIR` | Default working directory.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `Maven2ProjectPaths​(File projectRoot)` | Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `File` | `getCacheDirectory()` | Returns the default cache subdirectory where the torque generator can store internal files.
    `abstract String` | `getConfigurationPackage()` | Returns the package of the Torque generator configuration.
    `abstract File` | `getConfigurationPath()` | Returns the path to the Torque generator configuration directory.
    `File` | `getDefaultSourcePath()` | Returns the path to the source files.
    `File` | `getOutputDirectory​(String outputDirKey)` | Returns the output directory for a given output directory key.
    `Map<String,​File>` | `getOutputDirectoryMap()` | Returns the output directory map which contains the mapping from output directory key to output directory.
    `protected File` | `getProjectRoot()` | returns the root directory of the whole maven 2 project.
    `File` | `getWorkDirectory()` | Returns the default work subdirectory where the torque generator can store internal files.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CONFIG_DIR

          protected static final String CONFIG_DIR

      Default configuration root directory, relative to the project root.
      See Also:
        Constant Field Values

    - #### SOURCE_DIR

          protected static final String SOURCE_DIR

      Default generation source file directory, relative to the configuration root directory.
      See Also:
        Constant Field Values

    - #### MODIFIABLE_OUTPUT_DIR_KEY

          public static final String MODIFIABLE_OUTPUT_DIR_KEY

      Key for the target directory for generated files which are modifiable by the user, relative to the project root.
      See Also:
        Constant Field Values

    - #### MODIFIABLE_OUTPUT_DIR

          public static final String MODIFIABLE_OUTPUT_DIR

      Default generation target directory for generated files which are modifiable by the user, relative to the project root.
      See Also:
        Constant Field Values

    - #### DEFAULT_OUTPUT_DIR

          protected static final String DEFAULT_OUTPUT_DIR

      Default generation target directory, relative to the project root.
      See Also:
        Constant Field Values

    - #### WORK_DIR

          protected static final String WORK_DIR

      Default working directory.
      See Also:
        Constant Field Values

    - #### CACHE_DIR

          protected static final String CACHE_DIR

      Default cache directory.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Maven2ProjectPaths

          protected Maven2ProjectPaths​(File projectRoot)

      Constructor.
      Parameters:
        `projectRoot` - path to the project root directory, not null. The path must either be absolute or relative to the current working directory.
      Throws:
        `NullPointerException` - if projectRoot is null.

  - ### Method Detail

    - #### getConfigurationPath

          public abstract File getConfigurationPath()

      Description copied from interface: `ProjectPaths`
      Returns the path to the Torque generator configuration directory. The path must either be absolute or relative to the current working directory.
      Specified by:
        `getConfigurationPath` in interface `ProjectPaths`
      Returns:
        the path to the Torque generator configuration; may (but must not) be null if no configuration is contained in the surrounding project; must be null if the configuration is read from the class path.

    - #### getConfigurationPackage

          public abstract String getConfigurationPackage()

      Description copied from interface: `ProjectPaths`
      Returns the package of the Torque generator configuration.
      Specified by:
        `getConfigurationPackage` in interface `ProjectPaths`
      Returns:
        the package to the Torque generator configuration. Must be null if the configuration is read from the file system or from a jar file. Must not be null if the configuration is read from the class path.

    - #### getDefaultSourcePath

          public File getDefaultSourcePath()

      Returns the path to the source files.
      Specified by:
        `getDefaultSourcePath` in interface `ProjectPaths`
      Returns:
        the path to for the source files, not null.

    - #### getOutputDirectoryMap

          public Map<String,​File> getOutputDirectoryMap()

      Returns the output directory map which contains the mapping from output directory key to output directory.
      Specified by:
        `getOutputDirectoryMap` in interface `ProjectPaths`
      Returns:
        the unmodifiable output directory map, not null. Contains a mapping for the keys null and "modifiable".
      Throws:
        `IllegalStateException` - if the current state of the object is not valid.

    - #### getOutputDirectory

          public File getOutputDirectory​(String outputDirKey)

      Returns the output directory for a given output directory key.
      Specified by:
        `getOutputDirectory` in interface `ProjectPaths`
      Parameters:
        `outputDirKey` - the output directory key, or null for the default output directory.
      Returns:
        the output directory for the key, relative to the current directory, or absolute, not null.
      Throws:
        `IllegalArgumentException` - if the outputDirKey is unknown.

    - #### getWorkDirectory

          public File getWorkDirectory()

      Returns the default work subdirectory where the torque generator can store internal files.
      Specified by:
        `getWorkDirectory` in interface `ProjectPaths`
      Returns:
        the work subdirectory, not null.

    - #### getCacheDirectory

          public File getCacheDirectory()

      Returns the default cache subdirectory where the torque generator can store internal files.
      Specified by:
        `getCacheDirectory` in interface `ProjectPaths`
      Returns:
        the work subdirectory, not null.

    - #### getProjectRoot

          protected File getProjectRoot()

      returns the root directory of the whole maven 2 project.
      Returns:
        the root directory of the whole project, not null.