Package de.codecamp.messages.shared.conf
Class ProjectConf
- java.lang.Object
-
- de.codecamp.messages.shared.conf.ProjectConf
-
- All Implemented Interfaces:
MessageModule
public class ProjectConf extends Object implements MessageModule
ProjectConfcontains the aspects of the project configuration shared by the annotation processor and other tools like the Eclipse companion plug-in. It represents a snapshot of the current configuration, so it's not intended to be long lived or stored for later use.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ProjectConf(ConfValueProvider confProvider)
-
Method Summary
-
-
-
Field Detail
-
ERROR_CONF_FILE_ERROR
public static final String ERROR_CONF_FILE_ERROR
- See Also:
- Constant Field Values
-
ERROR_MISSING_OPTION
public static final String ERROR_MISSING_OPTION
- See Also:
- Constant Field Values
-
ERROR_ILLEGAL_LOCALE
public static final String ERROR_ILLEGAL_LOCALE
- See Also:
- Constant Field Values
-
ERROR_ILLEGAL_BUNDLE_MAPPING
public static final String ERROR_ILLEGAL_BUNDLE_MAPPING
- See Also:
- Constant Field Values
-
ERROR_ILLEGAL_TYPE_ABBREVIATION
public static final String ERROR_ILLEGAL_TYPE_ABBREVIATION
- See Also:
- Constant Field Values
-
ERROR_ILLEGAL_IMPORT
public static final String ERROR_ILLEGAL_IMPORT
- See Also:
- Constant Field Values
-
ERROR_MISSING_IMPORT
public static final String ERROR_MISSING_IMPORT
- See Also:
- Constant Field Values
-
ERROR_ILLEGAL_EXTERNAL_PACKAGE_MAPPING
public static final String ERROR_ILLEGAL_EXTERNAL_PACKAGE_MAPPING
- See Also:
- Constant Field Values
-
ERROR_UNKNOWN_VALUE
public static final String ERROR_UNKNOWN_VALUE
- See Also:
- Constant Field Values
-
PROJECT_CONF_FILE_NAME
public static final String PROJECT_CONF_FILE_NAME
- See Also:
- Constant Field Values
-
CONF_PREFIX
public static final String CONF_PREFIX
- See Also:
- Constant Field Values
-
CONF_PROJECT_DIR
public static final String CONF_PROJECT_DIR
- See Also:
- Constant Field Values
-
CONF_MODULE_NAME
public static final String CONF_MODULE_NAME
- See Also:
- Constant Field Values
-
CONF_BUNDLE_DIR
public static final String CONF_BUNDLE_DIR
- See Also:
- Constant Field Values
-
BUNDLE_DIR_DEFAULT
public static final String BUNDLE_DIR_DEFAULT
- See Also:
- Constant Field Values
-
CONF_BUNDLE_ENCODING
public static final String CONF_BUNDLE_ENCODING
- See Also:
- Constant Field Values
-
CONF_BUNDLES
public static final String CONF_BUNDLES
- See Also:
- Constant Field Values
-
CONF_IGNORED_BUNDLES
public static final String CONF_IGNORED_BUNDLES
- See Also:
- Constant Field Values
-
CONF_TARGET_LOCALES
public static final String CONF_TARGET_LOCALES
- See Also:
- Constant Field Values
-
CONF_IMPORTS
public static final String CONF_IMPORTS
- See Also:
- Constant Field Values
-
CONF_TYPE_ABBREVIATIONS
public static final String CONF_TYPE_ABBREVIATIONS
- See Also:
- Constant Field Values
-
CONF_MODE
public static final String CONF_MODE
- See Also:
- Constant Field Values
-
CONF_MISSING_MESSAGE_POLICY
public static final String CONF_MISSING_MESSAGE_POLICY
- See Also:
- Constant Field Values
-
CONF_MESSAGE_ARG_POLICY
public static final String CONF_MESSAGE_ARG_POLICY
- See Also:
- Constant Field Values
-
CONF_UNDECLARED_KEY_POLICY
public static final String CONF_UNDECLARED_KEY_POLICY
- See Also:
- Constant Field Values
-
CONF_UNDECLARED_KEY_COMMENT
public static final String CONF_UNDECLARED_KEY_COMMENT
- See Also:
- Constant Field Values
-
CONF_BUNDLE_MISMATCH_POLICY
public static final String CONF_BUNDLE_MISMATCH_POLICY
- See Also:
- Constant Field Values
-
CONF_MESSAGE_FORMAT
public static final String CONF_MESSAGE_FORMAT
- See Also:
- Constant Field Values
-
CONF_GENERATE_CONSTANTS
public static final String CONF_GENERATE_CONSTANTS
- See Also:
- Constant Field Values
-
CONF_GENERATE_PROXIES
public static final String CONF_GENERATE_PROXIES
- See Also:
- Constant Field Values
-
CONF_EXTERNAL_PACKAGE_MAPPING
public static final String CONF_EXTERNAL_PACKAGE_MAPPING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProjectConf
public ProjectConf(ConfValueProvider confProvider) throws ProjectConfException
- Throws:
ProjectConfException
-
-
Method Detail
-
getProjectDir
public String getProjectDir()
-
getModuleName
public String getModuleName()
- Specified by:
getModuleNamein interfaceMessageModule
-
getBundleDir
public String getBundleDir()
-
getBundleEncoding
public Charset getBundleEncoding()
-
getBundleMappings
public List<BundleMapping> getBundleMappings()
- Specified by:
getBundleMappingsin interfaceMessageModule
-
getTargetLocales
public List<Locale> getTargetLocales()
- Specified by:
getTargetLocalesin interfaceMessageModule
-
getImportedModules
public List<String> getImportedModules()
- Specified by:
getImportedModulesin interfaceMessageModule
-
getMode
public Mode getMode()
-
getMissingMessagePolicy
public MissingMessagePolicy getMissingMessagePolicy()
-
getMessageArgPolicy
public MessageArgPolicy getMessageArgPolicy()
-
getUndeclaredKeyPolicy
public UndeclaredKeyPolicy getUndeclaredKeyPolicy()
-
getUndeclaredKeyComment
public String getUndeclaredKeyComment()
-
getBundleMismatchPolicy
public BundleMismatchPolicy getBundleMismatchPolicy()
-
getMessageFormat
public String getMessageFormat()
- Specified by:
getMessageFormatin interfaceMessageModule
-
getGenerateConstants
public boolean getGenerateConstants()
-
getGenerateProxies
public boolean getGenerateProxies()
-
getExternalPackageMappings
public List<PackageMapping> getExternalPackageMappings()
-
resolveBundleMappings
public void resolveBundleMappings(Function<String,MessageModule> importedModuleProvider) throws ProjectConfException
- Throws:
ProjectConfException
-
toTargetBundleName
public Optional<String> toTargetBundleName(String messageKey)
Returns the most specific bundle name for the given message key after applying the bundle root mappings.- Parameters:
messageKey- a message key- Returns:
- the target bundle name for the given message key or null if no mapping is available
-
toTargetBundleName
public Optional<String> toTargetBundleName(String messageKey, boolean onlyLocalMappings)
-
createDefaultMessageBundleManager
public MessageBundleManager<Path,Path> createDefaultMessageBundleManager()
-
-