public class PropertiesJavaDefinitionPrinter extends Object
true
and the value not null
, it will try an analyze the value to see which matches best and output that type. CommentedProperties
Modifier and Type | Class and Description |
---|---|
(package private) static class |
PropertiesJavaDefinitionPrinter.ListTypedJavaDefinition |
(package private) static class |
PropertiesJavaDefinitionPrinter.TypedJavaDefinition |
Constructor and Description |
---|
PropertiesJavaDefinitionPrinter() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
generateJavaDefinitionsAsList(CommentedProperties properties,
boolean suggestType,
boolean writeJavaClassComments,
boolean writePropertyJavaComments,
boolean writePropertyDescription,
boolean writePropertyDescriptionInSeperateInterface)
Generates java code, from a commented properties instance.
|
static List<String> |
generateJavaDefinitionsAsList(File file,
boolean suggestType,
boolean writeJavaClassComments,
boolean writePropertyJavaComments,
boolean writePropertyDescription,
boolean writePropertyDescriptionInSeperateInterface)
Loads a file into a CommentedProperties instance and parses the properties.
|
static List<String> |
generateJavaDefinitionsAsList(Properties properties,
boolean suggestType)
Generates java code, from a properties instance.
|
static List<String> |
generateJavaDefinitionsAsList(PropertyIO io,
boolean suggestType)
Use a PropertyIO to load the properties that shall be parsed.
|
static List<String> |
generateJavaDefinitionsAsList(String text,
boolean suggestType,
boolean writeJavaClassComments,
boolean writePropertyJavaComments,
boolean writePropertyDescription,
boolean writePropertyDescriptionInSeperateInterface)
Loads a text into a CommentedProperties instance and parses the properties.
|
static boolean |
getBooleanParameter(String value,
boolean defaultValue)
Gets a boolean value from a string value.
|
static org.apache.commons.logging.Log |
getLogger() |
static void |
main(String[] args) |
public static List<String> generateJavaDefinitionsAsList(String text, boolean suggestType, boolean writeJavaClassComments, boolean writePropertyJavaComments, boolean writePropertyDescription, boolean writePropertyDescriptionInSeperateInterface) throws IOException
text
- the text to parse.suggestType
- should the generator, suggest a type property properly will be or just return a dummy type.writeJavaClassComments
- Taking all the lines starting with '##' before the first property and writes as Class Javadoc. Ignoring all lines that starts with '##!'writePropertyJavaComments
- Taking all the lines starting with '#' or '!' before a property and writes as it as Javadoc for the Property . Ignoring all lines that starts with '#!'.writePropertyDescription
- Taking all the lines starting with '#' or '!' before a property and writes as it as description string for the Property. Ignoring all lines that starts with '#!'.writePropertyDescriptionInSeperateInterface
- As in 'Write Property Description',but the description will be put in a seperate interface to avoid the Property definition line to get exceedingly long.IOException
- if any error generating the code.CommentedProperties
public static List<String> generateJavaDefinitionsAsList(File file, boolean suggestType, boolean writeJavaClassComments, boolean writePropertyJavaComments, boolean writePropertyDescription, boolean writePropertyDescriptionInSeperateInterface) throws IOException
file
- the file to load.suggestType
- should the generator, suggest a type property properly will be or just return a dummy type.writeJavaClassComments
- Taking all the lines starting with '##' before the first property and writes as Class Javadoc. Ignoring all lines that starts with '##!'writePropertyJavaComments
- Taking all the lines starting with '#' or '!' before a property and writes as it as Javadoc for the Property . Ignoring all lines that starts with '#!'.writePropertyDescription
- Taking all the lines starting with '#' or '!' before a property and writes as it as description string for the Property. Ignoring all lines that starts with '#!'.writePropertyDescriptionInSeperateInterface
- As in 'Write Property Description',but the description will be put in a seperate interface to avoid the Property definition line to get exceedingly long.IOException
- if any error generating the code.public static List<String> generateJavaDefinitionsAsList(PropertyIO io, boolean suggestType)
io
- the PropertyIO to load properties from.suggestType
- should the generator, suggest a type property properly will be or just return a dummy type.PropertyIO
public static List<String> generateJavaDefinitionsAsList(Properties properties, boolean suggestType)
properties
- the propertiessuggestType
- suggestType should the generator, suggest a type property properly will be or just return a dummy type.Properties
public static void main(String[] args)
public static boolean getBooleanParameter(String value, boolean defaultValue)
value
- the string valuedefaultValue
- the default if the string is null
.true
if the string is "true", false
if the string is "false", otherwise defaultValue.public static List<String> generateJavaDefinitionsAsList(CommentedProperties properties, boolean suggestType, boolean writeJavaClassComments, boolean writePropertyJavaComments, boolean writePropertyDescription, boolean writePropertyDescriptionInSeperateInterface)
properties
- the commented propertiessuggestType
- should the generator, suggest a type property properly will be or just return a dummy type.writeJavaClassComments
- Taking all the lines starting with '##' before the first property and writes as Class Javadoc. Ignoring all lines that starts with '##!'writePropertyJavaComments
- Taking all the lines starting with '#' or '!' before a property and writes as it as Javadoc for the Property . Ignoring all lines that starts with '#!'.writePropertyDescription
- Taking all the lines starting with '#' or '!' before a property and writes as it as description string for the Property. Ignoring all lines that starts with '#!'.writePropertyDescriptionInSeperateInterface
- As in 'Write Property Description',but the description will be put in a seperate interface to avoid the Property definition line to get exceedingly long.CommentedProperties
public static org.apache.commons.logging.Log getLogger()