public class ToolConfiguration extends Configuration
This class handles configuration info for tools, including their key,
classname, path restriction, and properties. It also does fairly
aggresive validation.
Once configuration is complete, a ToolInfo
instance can be created by calling
createInfo()
.
Most users will not find themselves directly using the API of this class.
Constructor and Description |
---|
ToolConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
addConfiguration(Configuration config) |
int |
compareTo(Configuration conf) |
ToolInfo |
createInfo() |
boolean |
equals(Object obj) |
String |
getClassname() |
String |
getDefaultKey()
Returns the default key value for the set tool class.
|
Class |
getFactory() |
String |
getFactoryClassname() |
String[] |
getInvalidScopes() |
String |
getKey()
Returns the key set for this tool.
|
String |
getRestrictTo() |
Boolean |
getSkipSetters() |
Class |
getToolClass() |
String[] |
getValidScopes() |
int |
hashCode() |
void |
setClass(Class clazz)
Deprecated.
|
void |
setClass(String classname) |
void |
setClassname(String classname) |
void |
setFactory(Class factory) |
void |
setFactoryClassname(String factoryClassname) |
void |
setKey(String key) |
void |
setRestrictTo(String path) |
void |
setSkipSetters(Boolean cfgOnly) |
String |
toString() |
void |
validate() |
addProperty, appendProperties, getProperties, getProperty, getPropertyMap, hasProperties, removeProperty, removeProperty, setProperties, setProperty, setPropertyMap
public void setKey(String key)
@Deprecated public void setClass(Class clazz)
clazz
- the ClasssetClassname(String classname)
public void setClass(String classname)
public void setClassname(String classname)
public void setFactory(Class factory)
public void setFactoryClassname(String factoryClassname)
public void setRestrictTo(String path)
public void setSkipSetters(Boolean cfgOnly)
public String getKey()
getDefaultKey()
.public String getDefaultKey()
DefaultKey
annotation on the tool class. Then,
if there is no default key annotation, the Class.getSimpleName()
is transformed into the key by removing any 'Tool' suffix and
lowercasing the first character. This will only return null
if there is both no key and no classname set for this tool.public String getClassname()
public String getFactoryClassname()
public Class getToolClass()
public Class getFactory()
public String[] getInvalidScopes()
public String[] getValidScopes()
public String getRestrictTo()
public Boolean getSkipSetters()
public ToolInfo createInfo()
public void addConfiguration(Configuration config)
addConfiguration
in class Configuration
public void validate()
validate
in class Configuration
public int compareTo(Configuration conf)
compareTo
in interface Comparable<Configuration>
compareTo
in class Configuration
public int hashCode()
hashCode
in class Configuration
public boolean equals(Object obj)
equals
in class Configuration
Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.