Constructor and Description |
---|
FieldSetter(java.lang.Object bean,
java.lang.reflect.Field f) |
Modifier and Type | Method and Description |
---|---|
void |
addValue(java.lang.Object value)
Adds/sets a value to the property of the option bean.
|
java.lang.reflect.AnnotatedElement |
asAnnotatedElement()
Returns the
AnnotatedElement by which you can access annotations written on this setter. |
FieldSetter |
asFieldSetter()
If this setter encapsulates a field, return the direct access to that field as
FieldSetter . |
java.lang.Class |
getType()
Gets the type of the underlying method/field.
|
java.lang.Object |
getValue() |
boolean |
isMultiValued()
Whether this setter is intrinsically multi-valued.
|
public java.lang.Class getType()
Setter
public boolean isMultiValued()
Setter
This characteristics of a setter does not affect option parsing at all, as any options can be specified multiple times (which in many cases are no-op, but when your shell script expands multiple environment variables that each can contain options, tolerating such redundant options are often useful.)
isMultiValued
in interface Setter
public FieldSetter asFieldSetter()
Setter
FieldSetter
. This method serves two purposes.
One is that this lets OptionHandler
s to bypass the collection/array handling of fields.
This is useful if you are defining an option handler that produces array or collection
from a single argument.
The other is to retrieve the current value of the field, via getValue()
.
asFieldSetter
in interface Setter
public java.lang.reflect.AnnotatedElement asAnnotatedElement()
Setter
AnnotatedElement
by which you can access annotations written on this setter.
This is the same AnnotatedElement
that had Option
/Argument
.
This enables OptionHandler
to further tweak its behavior based on additional annotations.
asAnnotatedElement
in interface Setter
public void addValue(java.lang.Object value)
Setter
A Setter
object has an implicit knowledge about the property it's setting,
and the instance of the option bean.
public java.lang.Object getValue()
Copyright © 2003-2013 Kohsuke Kawaguchi. All Rights Reserved.