Module info.picocli.codegen
Class AnnotatedElementHolder
- java.lang.Object
-
- picocli.codegen.annotation.processing.AnnotatedElementHolder
-
- All Implemented Interfaces:
CommandLine.Model.IGetter,CommandLine.Model.ISetter
public class AnnotatedElementHolder extends Object implements CommandLine.Model.IGetter, CommandLine.Model.ISetter
Implementation of theCommandLine.Model.IGetterandCommandLine.Model.ISetterinterface that allows customCommandSpecannotation processors to inspectArgSpecobjects to discover what program element was annotated with@Optionor@Parameters.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description AnnotatedElementHolder(Element element)Constructs a newAnnotatedElementHolderwith the specified element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tget()This implementation does nothing and always returnsnull.ElementgetElement()Returns the program element annotated with@Optionor@Parameters.<T> Tset(T value)This implementation does nothing.StringtoString()Returns a string representation of this binding, for debugging purposes.
-
-
-
Constructor Detail
-
AnnotatedElementHolder
public AnnotatedElementHolder(Element element)
Constructs a newAnnotatedElementHolderwith the specified element- Parameters:
element- the program element annotated with@Optionor@Parameters
-
-
Method Detail
-
getElement
public Element getElement()
Returns the program element annotated with@Optionor@Parameters.- Returns:
- the program element for an
ArgSpec.
-
get
public <T> T get()
This implementation does nothing and always returnsnull.- Specified by:
getin interfaceCommandLine.Model.IGetter- Type Parameters:
T- ignored- Returns:
nullalways
-
set
public <T> T set(T value)
This implementation does nothing.- Specified by:
setin interfaceCommandLine.Model.ISetter- Type Parameters:
T- ignored- Parameters:
value- the new value of the option or positional parameter. Ignored.- Returns:
nullalways
-
-