All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.carne.gradle.plugin.java.task.GenerateI18NTask.properties Maven / Gradle / Ivy

# No parameters
FILE_HEADER=\
/*\n\
\ * I18N resource strings (automatically generated - do not edit)\n\
\ */\n

# Parameter {0} = package name
PACKAGE_STATEMENT=\
package {0};\n\
\n

# Parameter {0} = bundle file
# Parameter {1} = class name
CLASS_START=\
import java.text.MessageFormat;\n\
import java.util.ResourceBundle;\n\
\n\
/**\n\
\ * Resource bundle: {0}\n\
\ */\n\
public final class {1} '{'\n\
\n\
\t/**\n\
\t * The name of the '{'@linkplain ResourceBundle'}' wrapped by this class.\n\
\t */\n\
\tpublic static final String BUNDLE_NAME = {1}.class.getName();\n\
\n\
\t/**\n\
\t * The '{'@linkplain ResourceBundle'}' wrapped by this class.\n\
\t */\n\
\tpublic static final ResourceBundle BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);\n\
\n\
\tprivate {1}() '{'\n\
\t\t// Prevent instantiation\n\
\t'}'\n\
\n\
\t/**\n\
\t * Format a resource string.\n\
\t * @param key The resource key.\n\
\t * @param arguments Format arguments.\n\
\t * @return The formatted string.\n\
\t */\n\
\tpublic static String format(String key, Object... arguments) '{'\n\
\t\tString pattern = BUNDLE.getString(key);\n\
\n\
\t\treturn MessageFormat.format(pattern, arguments);\n\
\t'}'\n\
\n

# Parameter {0} = bundle key
# Parameter {1} = mangled bundle key
# Parameter {2} = bundle string
CLASS_BODY=\
\t/**\n\
\t * Resource key '{'@code {0}'}'\n\
\t * 

\n\ \t * {2}\n\ \t */\n\ \tpublic static final String {0} = \"{0}\";\n\ \n\ \t/**\n\ \t * Resource string '{'@code {0}'}'\n\ \t *

\n\ \t * {2}\n\ \t *\n\ \t * @param arguments Format arguments.\n\ \t * @return The formatted string.\n\ \t */\n\ \tpublic static String {1}(Object... arguments) '{'\n\ \t\treturn format({0}, arguments);\n\ \t'}'\n\ \n # No parameters CLASS_END=\ '}'\n





© 2015 - 2025 Weber Informatics LLC | Privacy Policy