Package picocli
Class CommandLine.Model.TypedMember
- java.lang.Object
-
- picocli.CommandLine.Model.TypedMember
-
- All Implemented Interfaces:
CommandLine.Model.IAnnotatedElement
,CommandLine.Model.IExtensible
- Enclosing class:
- CommandLine.Model
static class CommandLine.Model.TypedMember extends java.lang.Object implements CommandLine.Model.IAnnotatedElement, CommandLine.Model.IExtensible
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.reflect.AccessibleObject
accessible
private CommandLine.Model.IGetter
getter
private CommandLine.Model.InitialValueState
initialValueState
(package private) java.lang.String
name
private CommandLine.Model.IScope
scope
private CommandLine.Model.ISetter
setter
(package private) CommandLine.Model.ITypeInfo
typeInfo
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
TypedMember(java.lang.reflect.Field field)
private
TypedMember(java.lang.reflect.Field field, CommandLine.Model.IScope scope)
private
TypedMember(java.lang.reflect.Method method, CommandLine.Model.IScope scope, CommandLine.Model.CommandSpec spec)
(package private)
TypedMember(CommandLine.Model.MethodParam param, CommandLine.Model.IScope scope)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.String
abbreviate(java.lang.String text)
private java.lang.Class<?>[]
annotationTypes()
(package private) static CommandLine.Model.TypedMember
createIfAnnotated(java.lang.reflect.Field field, CommandLine.Model.IScope scope)
(package private) static CommandLine.Model.TypedMember
createIfAnnotated(java.lang.reflect.Method method, CommandLine.Model.IScope scope, CommandLine.Model.CommandSpec spec)
private CommandLine.Model.ITypeInfo
createTypeInfo(java.lang.Class<?> type, java.lang.reflect.Type genericType)
private static java.lang.String
decapitalize(java.lang.String name)
<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)
java.lang.Class<?>[]
getAuxiliaryTypes()
<T> T
getExtension(java.lang.Class<T> cls)
Returns an instance of the specified class, ornull
if this extension is not supported.int
getMethodParamPosition()
java.lang.String
getMixinName()
java.lang.String
getName()
CommandLine.Model.IGetter
getter()
java.lang.String
getToString()
java.lang.Class<?>
getType()
CommandLine.Model.ITypeInfo
getTypeInfo()
boolean
hasInitialValue()
private void
initializeInitialValue(java.lang.Object arg)
(package private) static boolean
isAnnotated(java.lang.reflect.AnnotatedElement e)
boolean
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
boolean
isArgGroup()
boolean
isArgSpec()
boolean
isInteractive()
boolean
isMethodParameter()
boolean
isMixin()
boolean
isMultiValue()
boolean
isOption()
boolean
isParameter()
boolean
isParentCommand()
boolean
isSpec()
boolean
isUnmatched()
(package private) static java.lang.String
propertyName(java.lang.String methodName)
CommandLine.Model.IScope
scope()
CommandLine.Model.ISetter
setter()
java.lang.String
toGenericString()
java.lang.String
toString()
java.lang.Object
userObject()
-
-
-
Field Detail
-
accessible
final java.lang.reflect.AccessibleObject accessible
-
name
final java.lang.String name
-
typeInfo
final CommandLine.Model.ITypeInfo typeInfo
-
initialValueState
private final CommandLine.Model.InitialValueState initialValueState
-
scope
private CommandLine.Model.IScope scope
-
getter
private CommandLine.Model.IGetter getter
-
setter
private CommandLine.Model.ISetter setter
-
-
Constructor Detail
-
TypedMember
TypedMember(java.lang.reflect.Field field)
-
TypedMember
private TypedMember(java.lang.reflect.Field field, CommandLine.Model.IScope scope)
-
TypedMember
private TypedMember(java.lang.reflect.Method method, CommandLine.Model.IScope scope, CommandLine.Model.CommandSpec spec)
-
TypedMember
TypedMember(CommandLine.Model.MethodParam param, CommandLine.Model.IScope scope)
-
-
Method Detail
-
createIfAnnotated
static CommandLine.Model.TypedMember createIfAnnotated(java.lang.reflect.Field field, CommandLine.Model.IScope scope)
-
isAnnotated
static boolean isAnnotated(java.lang.reflect.AnnotatedElement e)
-
createIfAnnotated
static CommandLine.Model.TypedMember createIfAnnotated(java.lang.reflect.Method method, CommandLine.Model.IScope scope, CommandLine.Model.CommandSpec spec)
-
createTypeInfo
private CommandLine.Model.ITypeInfo createTypeInfo(java.lang.Class<?> type, java.lang.reflect.Type genericType)
-
initializeInitialValue
private void initializeInitialValue(java.lang.Object arg)
-
userObject
public java.lang.Object userObject()
- Specified by:
userObject
in interfaceCommandLine.Model.IAnnotatedElement
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Specified by:
isAnnotationPresent
in interfaceCommandLine.Model.IAnnotatedElement
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotation
in interfaceCommandLine.Model.IAnnotatedElement
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceCommandLine.Model.IAnnotatedElement
-
isArgSpec
public boolean isArgSpec()
- Specified by:
isArgSpec
in interfaceCommandLine.Model.IAnnotatedElement
-
isOption
public boolean isOption()
- Specified by:
isOption
in interfaceCommandLine.Model.IAnnotatedElement
-
isParameter
public boolean isParameter()
- Specified by:
isParameter
in interfaceCommandLine.Model.IAnnotatedElement
-
isArgGroup
public boolean isArgGroup()
- Specified by:
isArgGroup
in interfaceCommandLine.Model.IAnnotatedElement
-
isMixin
public boolean isMixin()
- Specified by:
isMixin
in interfaceCommandLine.Model.IAnnotatedElement
-
isUnmatched
public boolean isUnmatched()
- Specified by:
isUnmatched
in interfaceCommandLine.Model.IAnnotatedElement
-
isSpec
public boolean isSpec()
- Specified by:
isSpec
in interfaceCommandLine.Model.IAnnotatedElement
-
isParentCommand
public boolean isParentCommand()
- Specified by:
isParentCommand
in interfaceCommandLine.Model.IAnnotatedElement
-
isMultiValue
public boolean isMultiValue()
- Specified by:
isMultiValue
in interfaceCommandLine.Model.IAnnotatedElement
-
isInteractive
public boolean isInteractive()
- Specified by:
isInteractive
in interfaceCommandLine.Model.IAnnotatedElement
-
scope
public CommandLine.Model.IScope scope()
- Specified by:
scope
in interfaceCommandLine.Model.IAnnotatedElement
-
getter
public CommandLine.Model.IGetter getter()
- Specified by:
getter
in interfaceCommandLine.Model.IAnnotatedElement
-
setter
public CommandLine.Model.ISetter setter()
- Specified by:
setter
in interfaceCommandLine.Model.IAnnotatedElement
-
getTypeInfo
public CommandLine.Model.ITypeInfo getTypeInfo()
- Specified by:
getTypeInfo
in interfaceCommandLine.Model.IAnnotatedElement
-
getType
public java.lang.Class<?> getType()
-
getAuxiliaryTypes
public java.lang.Class<?>[] getAuxiliaryTypes()
-
annotationTypes
private java.lang.Class<?>[] annotationTypes()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getToString
public java.lang.String getToString()
- Specified by:
getToString
in interfaceCommandLine.Model.IAnnotatedElement
-
toGenericString
public java.lang.String toGenericString()
-
hasInitialValue
public boolean hasInitialValue()
- Specified by:
hasInitialValue
in interfaceCommandLine.Model.IAnnotatedElement
-
isMethodParameter
public boolean isMethodParameter()
- Specified by:
isMethodParameter
in interfaceCommandLine.Model.IAnnotatedElement
-
getMethodParamPosition
public int getMethodParamPosition()
- Specified by:
getMethodParamPosition
in interfaceCommandLine.Model.IAnnotatedElement
-
getMixinName
public java.lang.String getMixinName()
- Specified by:
getMixinName
in interfaceCommandLine.Model.IAnnotatedElement
-
propertyName
static java.lang.String propertyName(java.lang.String methodName)
-
decapitalize
private static java.lang.String decapitalize(java.lang.String name)
-
abbreviate
static java.lang.String abbreviate(java.lang.String text)
-
getExtension
public <T> T getExtension(java.lang.Class<T> cls)
Description copied from interface:CommandLine.Model.IExtensible
Returns an instance of the specified class, ornull
if this extension is not supported.- Specified by:
getExtension
in interfaceCommandLine.Model.IExtensible
- Parameters:
cls
- class of the desired extension
-
-