Class CompletionCandidatesMetaData

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>, ITypeMetaData

    class CompletionCandidatesMetaData
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.String>, ITypeMetaData
    Implementation of the Iterable interface that provides metadata on the @Command(completionCandidates = xxx.class) annotation.
    Since:
    4.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.lang.model.type.TypeMirror typeMirror  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Iterable<java.lang.String> extract​(javax.lang.model.element.Element element)
      Returns the completion candidates from the annotations present on the specified element.
      javax.lang.model.element.TypeElement getTypeElement()
      Returns the TypeElement of the type mirror.
      javax.lang.model.type.TypeMirror getTypeMirror()
      Returns the TypeMirror that this TypeConverterMetaData was constructed with.
      boolean isDefault()
      Returns true if the command did not have a completionCandidates annotation attribute.
      java.util.Iterator<java.lang.String> iterator()
      Always returns null.
      java.lang.String toString()
      Returns a string representation of this object, for debugging purposes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • typeMirror

        private final javax.lang.model.type.TypeMirror typeMirror
    • Constructor Detail

      • CompletionCandidatesMetaData

        public CompletionCandidatesMetaData​(javax.lang.model.type.TypeMirror typeMirror)
    • Method Detail

      • extract

        public static java.lang.Iterable<java.lang.String> extract​(javax.lang.model.element.Element element)
        Returns the completion candidates from the annotations present on the specified element.
        Parameters:
        element - the method or field annotated with @Option or @Parameters
        Returns:
        the completion candidates or null if not found
      • isDefault

        public boolean isDefault()
        Returns true if the command did not have a completionCandidates annotation attribute.
        Specified by:
        isDefault in interface ITypeMetaData
        Returns:
        true if the command did not have a completionCandidates annotation attribute.
      • getTypeMirror

        public javax.lang.model.type.TypeMirror getTypeMirror()
        Returns the TypeMirror that this TypeConverterMetaData was constructed with.
        Specified by:
        getTypeMirror in interface ITypeMetaData
        Returns:
        the TypeMirror of the @Command(completionCandidates = xxx.class) annotation.
      • getTypeElement

        public javax.lang.model.element.TypeElement getTypeElement()
        Description copied from interface: ITypeMetaData
        Returns the TypeElement of the type mirror.
        Specified by:
        getTypeElement in interface ITypeMetaData
        Returns:
        the type mirror as a TypeElement
      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Always returns null.
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>
      • toString

        public java.lang.String toString()
        Returns a string representation of this object, for debugging purposes.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this object