uk.ac.starlink.ttools.plot2.config
Class SkySysConfigKey

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.config.ConfigKey<T>
      extended by uk.ac.starlink.ttools.plot2.config.OptionConfigKey<SkySys>
          extended by uk.ac.starlink.ttools.plot2.config.SkySysConfigKey

public class SkySysConfigKey
extends OptionConfigKey<SkySys>

ConfigKey for selecting sky coordinate systems.

Since:
10 Sep 2014
Author:
Mark Taylor

Constructor Summary
SkySysConfigKey(ConfigMeta meta, boolean includeNull)
          Constructor.
 
Method Summary
 String getXmlDescription(SkySys sys)
          Returns a description in XML of the given option value.
 SkySys stringToValue(String str)
          Calls valueToString repeatedly looking for a match.
 String valueToString(SkySys sys)
          Invokes the toString method of the supplied option.
 
Methods inherited from class uk.ac.starlink.ttools.plot2.config.OptionConfigKey
addOptionsXml, createSpecifier, getOptions, getOptionsXml, setOptionUsage
 
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey
cast, getDefaultValue, getMeta, getValueClass, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SkySysConfigKey

public SkySysConfigKey(ConfigMeta meta,
                       boolean includeNull)
Constructor.

Parameters:
meta - config key metadata
includeNull - true iff null is a permitted option
Method Detail

valueToString

public String valueToString(SkySys sys)
Description copied from class: OptionConfigKey
Invokes the toString method of the supplied option. May be overridden.

Overrides:
valueToString in class OptionConfigKey<SkySys>
Parameters:
sys - possible value associated with this key
Returns:
string representation

stringToValue

public SkySys stringToValue(String str)
                     throws ConfigException
Description copied from class: OptionConfigKey
Calls valueToString repeatedly looking for a match. This means that if valueToString is overridden it is usually not necessary to override this method.

Overrides:
stringToValue in class OptionConfigKey<SkySys>
Parameters:
str - string representation of value
Returns:
value
Throws:
ConfigException

getXmlDescription

public String getXmlDescription(SkySys sys)
Description copied from class: OptionConfigKey
Returns a description in XML of the given option value. This, along with OptionConfigKey.valueToString(T), is used by the OptionConfigKey.getOptionsXml() method to assemble a described list of the options.

Specified by:
getXmlDescription in class OptionConfigKey<SkySys>
Parameters:
sys - possible value of this key
Returns:
short snippet of XML (not wrapped in any outer element) describing the value; may be null if no description required or available


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.