Class TypeConverterMetaData
- java.lang.Object
-
- picocli.codegen.annotation.processing.TypeConverterMetaData
-
- All Implemented Interfaces:
ITypeMetaData,CommandLine.ITypeConverter
class TypeConverterMetaData extends java.lang.Object implements CommandLine.ITypeConverter, ITypeMetaData
Implementation of theCommandLine.ITypeConverterinterface that provides metadata on the@Command(typeConverter = xxx.class)annotation.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private javax.lang.model.type.TypeMirrortypeMirror
-
Constructor Summary
Constructors Constructor Description TypeConverterMetaData(javax.lang.model.type.TypeMirror typeMirror)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectconvert(java.lang.String value)Always returnsnull.static TypeConverterMetaData[]extract(javax.lang.model.element.Element element)Returns the type converters from the annotations present on the specified element.javax.lang.model.element.TypeElementgetTypeElement()Returns theTypeElementof thetype mirror.javax.lang.model.type.TypeMirrorgetTypeMirror()Returns the TypeMirror that this TypeConverterMetaData was constructed with.booleanisDefault()Returnstrueif the command did not have atypeConverterannotation attribute.java.lang.StringtoString()Returns a string representation of this object, for debugging purposes.
-
-
-
Method Detail
-
extract
public static TypeConverterMetaData[] 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@Optionor@Parameters- Returns:
- the type converters or an empty array if not found
-
isDefault
public boolean isDefault()
Returnstrueif the command did not have atypeConverterannotation attribute.- Specified by:
isDefaultin interfaceITypeMetaData- Returns:
trueif the command did not have atypeConverterannotation attribute.
-
getTypeMirror
public javax.lang.model.type.TypeMirror getTypeMirror()
Returns the TypeMirror that this TypeConverterMetaData was constructed with.- Specified by:
getTypeMirrorin interfaceITypeMetaData- Returns:
- the TypeMirror of the
@Command(typeConverter = xxx.class)annotation.
-
getTypeElement
public javax.lang.model.element.TypeElement getTypeElement()
Description copied from interface:ITypeMetaDataReturns theTypeElementof thetype mirror.- Specified by:
getTypeElementin interfaceITypeMetaData- Returns:
- the type mirror as a TypeElement
-
convert
public java.lang.Object convert(java.lang.String value)
Always returnsnull.- Specified by:
convertin interfaceCommandLine.ITypeConverter- Parameters:
value- the command line argument String value- Returns:
- the resulting domain object
-
toString
public java.lang.String toString()
Returns a string representation of this object, for debugging purposes.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this object
-
-