Class ParameterConsumerMetaData
- java.lang.Object
-
- picocli.codegen.annotation.processing.ParameterConsumerMetaData
-
- All Implemented Interfaces:
ITypeMetaData
,CommandLine.IParameterConsumer
class ParameterConsumerMetaData extends java.lang.Object implements CommandLine.IParameterConsumer, ITypeMetaData
Implementation of theCommandLine.IParameterConsumer
interface that provides metadata on the@Option(parameterConsumer = xxx.class)
annotation.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private javax.lang.model.type.TypeMirror
typeMirror
-
Constructor Summary
Constructors Constructor Description ParameterConsumerMetaData(javax.lang.model.type.TypeMirror typeMirror)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consumeParameters(java.util.Stack<java.lang.String> args, CommandLine.Model.ArgSpec argSpec, CommandLine.Model.CommandSpec commandSpec)
Does nothing.static ParameterConsumerMetaData
extract(javax.lang.model.element.Element element)
Returns the type converters from the annotations present on the specified element.javax.lang.model.element.TypeElement
getTypeElement()
Returns theTypeElement
of thetype mirror
.javax.lang.model.type.TypeMirror
getTypeMirror()
Returns the TypeMirror that this TypeConverterMetaData was constructed with.boolean
isDefault()
Returnstrue
if the command did not have atypeConverter
annotation attribute.java.lang.String
toString()
Returns a string representation of this object, for debugging purposes.
-
-
-
Method Detail
-
extract
public static ParameterConsumerMetaData extract(javax.lang.model.element.Element element)
Returns the type converters from the annotations present on the specified element.- Parameters:
element
- the method or field annotated with@Option
or@Parameters
- Returns:
- the type converters or an empty array if not found
-
isDefault
public boolean isDefault()
Returnstrue
if the command did not have atypeConverter
annotation attribute.- Specified by:
isDefault
in interfaceITypeMetaData
- Returns:
true
if the command did not have atypeConverter
annotation attribute.
-
getTypeMirror
public javax.lang.model.type.TypeMirror getTypeMirror()
Returns the TypeMirror that this TypeConverterMetaData was constructed with.- Specified by:
getTypeMirror
in interfaceITypeMetaData
- Returns:
- the TypeMirror of the
@Command(typeConverter = xxx.class)
annotation.
-
getTypeElement
public javax.lang.model.element.TypeElement getTypeElement()
Description copied from interface:ITypeMetaData
Returns theTypeElement
of thetype mirror
.- Specified by:
getTypeElement
in interfaceITypeMetaData
- Returns:
- the type mirror as a TypeElement
-
consumeParameters
public void consumeParameters(java.util.Stack<java.lang.String> args, CommandLine.Model.ArgSpec argSpec, CommandLine.Model.CommandSpec commandSpec)
Does nothing.- Specified by:
consumeParameters
in interfaceCommandLine.IParameterConsumer
- Parameters:
args
- the command line argumentsargSpec
- the option or positional parameter for which to consume command line argumentscommandSpec
- the command that the option or positional parameter belongs to
-
toString
public java.lang.String toString()
Returns a string representation of this object, for debugging purposes.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this object
-
-