org.zanata.client.commands
Class AbstractPushPullOptionsImpl<O extends PushPullOptions>

java.lang.Object
  extended by org.zanata.client.commands.BasicOptionsImpl
      extended by org.zanata.client.commands.ConfigurableOptionsImpl
          extended by org.zanata.client.commands.ConfigurableProjectOptionsImpl
              extended by org.zanata.client.commands.AbstractPushPullOptionsImpl<O>
All Implemented Interfaces:
BasicOptions, ConfigurableOptions, ConfigurableProjectOptions, PushPullOptions
Direct Known Subclasses:
PullOptionsImpl, PushOptionsImpl

public abstract class AbstractPushPullOptionsImpl<O extends PushPullOptions>
extends ConfigurableProjectOptionsImpl
implements PushPullOptions

Specifies options that have the same description and defaults for push and pull

Author:
David Mason, damason@redhat.com

Field Summary
protected  String[] locales
           
protected static String PROJECT_TYPE_FILE
           
 
Constructor Summary
AbstractPushPullOptionsImpl()
           
 
Method Summary
 String buildFromDocArgument(String argValue)
          This name should represent the exact parameter as it would be entered on the command line, and include any space or operators that would link the parameter to the argument.
 Set<String> getAllModules()
           
 String getCurrentModule()
           
 String getCurrentModule(boolean canonicalName)
           
 String getDocNameRegex()
          A regex for document names, which captures the module ID as group 1 and the unqualified docname as group 2.
 boolean getEnableModules()
           
 String getFromDoc()
           
 LocaleList getLocaleMapList()
          Override the parent method as the push and pull commands can have locales specified via command line.
 String getModuleSuffix()
          Character or characters which must appear after moduleIDs when constructing qualified document names
 File getSrcDir()
           
 String getSrcDirParameterName()
           
 File getTransDir()
           
 boolean isDryRun()
           
 boolean isRootModule()
           
 void setDryRun(boolean dryRun)
           
 void setFromDoc(String fromDoc)
           
 void setSrcDir(File file)
           
 void setTransDir(File transDir)
           
 
Methods inherited from class org.zanata.client.commands.ConfigurableProjectOptionsImpl
getProj, getProjectConfig, getProjectType, getProjectVersion, setLocaleMapList, setProj, setProjectConfig, setProjectType, setProjectVersion
 
Methods inherited from class org.zanata.client.commands.ConfigurableOptionsImpl
getKey, getLogHttp, getUrl, getUserConfig, getUsername, isDisableSSLCert, setDisableSSLCert, setKey, setLogHttp, setUrl, setUserConfig, setUsername
 
Methods inherited from class org.zanata.client.commands.BasicOptionsImpl
getDebug, getErrors, getHelp, getQuiet, isDebugSet, isErrorsSet, isInteractiveMode, isQuietSet, setBatchMode, setDebug, setErrors, setHelp, setInteractiveMode, setQuiet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.zanata.client.commands.ConfigurableProjectOptions
getProj, getProjectConfig, getProjectType, getProjectVersion, setLocaleMapList, setProj, setProjectConfig, setProjectType, setProjectVersion
 
Methods inherited from interface org.zanata.client.commands.ConfigurableOptions
getKey, getLogHttp, getUrl, getUserConfig, getUsername, isDisableSSLCert, setDisableSSLCert, setKey, setLogHttp, setUrl, setUserConfig, setUsername
 
Methods inherited from interface org.zanata.client.commands.BasicOptions
getCommandDescription, getCommandName, getDebug, getErrors, getHelp, getQuiet, initCommand, isDebugSet, isErrorsSet, isInteractiveMode, isQuietSet, setDebug, setErrors, setHelp, setInteractiveMode, setQuiet
 

Field Detail

PROJECT_TYPE_FILE

protected static final String PROJECT_TYPE_FILE
See Also:
Constant Field Values

locales

protected String[] locales
Constructor Detail

AbstractPushPullOptionsImpl

public AbstractPushPullOptionsImpl()
Method Detail

getLocaleMapList

public LocaleList getLocaleMapList()
Override the parent method as the push and pull commands can have locales specified via command line.

Specified by:
getLocaleMapList in interface ConfigurableProjectOptions
Overrides:
getLocaleMapList in class ConfigurableProjectOptionsImpl
Returns:
The locale map list taking into account the global locales in zanata.xml as well as the command line argument ones.

getSrcDir

public File getSrcDir()
Specified by:
getSrcDir in interface PushPullOptions

setSrcDir

public void setSrcDir(File file)

getSrcDirParameterName

public String getSrcDirParameterName()
Specified by:
getSrcDirParameterName in interface PushPullOptions

getTransDir

public File getTransDir()
Specified by:
getTransDir in interface PushPullOptions

setTransDir

public void setTransDir(File transDir)

getFromDoc

public String getFromDoc()
Specified by:
getFromDoc in interface PushPullOptions

buildFromDocArgument

public String buildFromDocArgument(String argValue)
Description copied from interface: PushPullOptions
This name should represent the exact parameter as it would be entered on the command line, and include any space or operators that would link the parameter to the argument. This is so that the argument can be appended directly to the parameter name.

Specified by:
buildFromDocArgument in interface PushPullOptions

setFromDoc

public void setFromDoc(String fromDoc)

isDryRun

public boolean isDryRun()
Specified by:
isDryRun in interface PushPullOptions

setDryRun

public void setDryRun(boolean dryRun)

getEnableModules

public boolean getEnableModules()
Specified by:
getEnableModules in interface PushPullOptions

getDocNameRegex

public String getDocNameRegex()
Description copied from interface: PushPullOptions
A regex for document names, which captures the module ID as group 1 and the unqualified docname as group 2. This regex should broadly follow the pattern "(moduleID)moduleSuffix(localDocName)".

Specified by:
getDocNameRegex in interface PushPullOptions

getModuleSuffix

public String getModuleSuffix()
Description copied from interface: PushPullOptions
Character or characters which must appear after moduleIDs when constructing qualified document names

Specified by:
getModuleSuffix in interface PushPullOptions
Returns:

isRootModule

public boolean isRootModule()
Specified by:
isRootModule in interface PushPullOptions

getCurrentModule

public String getCurrentModule()
Specified by:
getCurrentModule in interface PushPullOptions

getCurrentModule

public String getCurrentModule(boolean canonicalName)
Specified by:
getCurrentModule in interface PushPullOptions
Parameters:
canonicalName - true if the module name should be in the canonical format used by maven
Returns:

getAllModules

public Set<String> getAllModules()
Specified by:
getAllModules in interface PushPullOptions


Copyright © 2013 Zanata Project. All Rights Reserved.