public class OptionsUtil extends Object
Constructor and Description |
---|
OptionsUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
applyConfigFiles(ConfigurableOptions opts)
Loads the config files (controlled by the property userConfig) to supply
any values which haven't already been set.
|
static void |
applyConfigToGlossaryOptions(ConfigurableGlossaryOptions opts) |
protected static void |
applyIncludesAndExcludesFromProjectConfig(ConfigurableProjectOptions opts,
ZanataConfig config)
Note: command line options take precedence over pom.xml which
takes precedence over zanata.xml.
|
static Optional<ZanataConfig> |
applyProjectConfigToProjectOptions(ConfigurableProjectOptions opts) |
protected static void |
applySrcDirAndTransDirFromProjectConfig(ConfigurableProjectOptions opts,
ZanataConfig config)
Note: command line options take precedence over pom.xml which
takes precedence over zanata.xml.
|
static void |
applyUserConfig(ConfigurableOptions opts,
org.apache.commons.configuration.HierarchicalINIConfiguration config)
Applies values from the user's personal configuration unless they have
been set directly (by parameters or by project configuration).
|
protected static void |
checkPotentialMistakesInRules(ConfigurableProjectOptions opts,
ConsoleInteractor console)
Will check potential mistakes in file mapping rules.
|
static <O extends ConfigurableOptions> |
createClientFactory(O opts)
Creates rest client factory that will perform an eager REST version check.
|
static <O extends ConfigurableOptions> |
createClientFactoryWithoutVersionCheck(O opts)
Creates rest client factory that will NOT perform an eager REST version
check.
|
static LocaleList |
fetchLocalesFromServer(ConfigurableProjectOptions projectOpts,
RestClientFactory restClientFactory) |
static Optional<ZanataConfig> |
readProjectConfigFile(ConfigurableProjectOptions projOpts)
Unmarshal project config (zanata.xml) file.
|
static boolean |
shouldFetchLocalesFromServer(Optional<ZanataConfig> projectConfig,
ConfigurableOptions opts) |
static String |
stripValidHolders(String rule) |
public static void applyConfigFiles(ConfigurableOptions opts) throws org.apache.commons.configuration.ConfigurationException, JAXBException
Exception
org.apache.commons.configuration.ConfigurationException
JAXBException
public static Optional<ZanataConfig> applyProjectConfigToProjectOptions(ConfigurableProjectOptions opts) throws JAXBException
JAXBException
public static boolean shouldFetchLocalesFromServer(Optional<ZanataConfig> projectConfig, ConfigurableOptions opts)
public static void applyConfigToGlossaryOptions(ConfigurableGlossaryOptions opts) throws JAXBException
JAXBException
public static Optional<ZanataConfig> readProjectConfigFile(ConfigurableProjectOptions projOpts) throws JAXBException
projOpts
- project optionsJAXBException
public static LocaleList fetchLocalesFromServer(ConfigurableProjectOptions projectOpts, RestClientFactory restClientFactory)
protected static void checkPotentialMistakesInRules(ConfigurableProjectOptions opts, ConsoleInteractor console)
opts
- console
- protected static void applySrcDirAndTransDirFromProjectConfig(ConfigurableProjectOptions opts, ZanataConfig config)
opts
- optionsconfig
- config from project configuration file i.e. zanata.xmlOptionMismatchChecker
protected static void applyIncludesAndExcludesFromProjectConfig(ConfigurableProjectOptions opts, ZanataConfig config)
opts
- optionsconfig
- config from project configuration file i.e. zanata.xmlOptionMismatchChecker
public static void applyUserConfig(ConfigurableOptions opts, org.apache.commons.configuration.HierarchicalINIConfiguration config)
config
- public static <O extends ConfigurableOptions> RestClientFactory createClientFactory(O opts)
public static <O extends ConfigurableOptions> RestClientFactory createClientFactoryWithoutVersionCheck(O opts)
Copyright © 2017 Zanata Project. All rights reserved.