org.appng.tools.file

## Class PropertyConstantCreator

- java.lang.Object
- - org.appng.tools.file.PropertyConstantCreator

-     public class PropertyConstantCreator
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PropertyConstantCreator()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(String[] args)` Generates a .java file containing constants for all the keys defined in the given property-file.

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

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

- - ### Constructor Detail

    - #### PropertyConstantCreator

          public PropertyConstantCreator()

  - ### Method Detail

    - #### main

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

      Generates a .java file containing constants for all the keys defined in the given property-file. For the constant's name, dots (.) and Dashes (-) are replaced with an underscore (_). Also, for a camel-case an underscore is being added.
      Usage:

           PropertyConstantCreator
                          .main(new String[] { "path/to/file.properties", "org.appng.example.Constants", "target/constants" })

      Parameters:
        `args` - args[0]* - the path to the property file to use
        args[1]* - the fully qualified name of the target class to generate
        args[2]* - the output-folder for the generated class
        args[3] - the charset used to read the properties file, defaults to `System.getProperty("file.encoding")`
      Throws:
        `IOException` - if the property file can not be found or the target class can not be written
        `IllegalArgumentException` - if one of the parameters is missing

Copyright © 2011–2023 aiticon GmbH. All rights reserved.