Package org.appng.tools.file
Class PropertyConstantCreator
- java.lang.Object
-
- org.appng.tools.file.PropertyConstantCreator
-
public class PropertyConstantCreator extends Object
-
-
Constructor Summary
Constructors Constructor Description PropertyConstantCreator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
Generates a .java file containing constants for all the keys defined in the given property-file.
-
-
-
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 toSystem.getProperty("file.encoding")
- Throws:
IOException
- if the property file can not be found or the target class can not be writtenIllegalArgumentException
- if one of the parameters is missing
-
-