Class DefaultJavaParameter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getBinaryName()
      The class or interface must be named by its binary name, which must meet the following constraints: The binary name of a top level type is its canonical name. The binary name of a member type consists of the binary name of its immediately enclosing type, followed by $, followed by the simple name of the member.
      java.lang.String getCanonicalName()
      Equivalent of (@link Class.getCanonicalName().
      java.lang.String getCodeBlock()
      JavaClass getDeclaringClass()
      Not every entity has a parentClass, but AnnotationFieldRef requires access to it.
      JavaExecutable getExecutable()
      Returns the declaring method or constructor of this parameter
      java.lang.String getFullyQualifiedName()
      Every primitive type, named package, top level class, and top level interface has a fully qualified name: The fully qualified name of a primitive type is the keyword for that primitive type, namely byte, short, char, int, long, float, double, or boolean. The fully qualified name of a named package that is not a subpackage of a named package is its simple name. The fully qualified name of a named package that is a subpackage of another named package consists of the fully qualified name of the containing package, followed by ".", followed by the simple (member) name of the subpackage. The fully qualified name of a top level class or top level interface that is declared in an unnamed package is the simple name of the class or interface. The fully qualified name of a top level class or top level interface that is declared in a named package consists of the fully qualified name of the package, followed by ".", followed by the simple name of the class or interface. Each member class, member interface, and array type may have a fully qualified name: A member class or member interface M of another class or interface C has a fully qualified name if and only if C has a fully qualified name. In that case, the fully qualified name of M consists of the fully qualified name of C, followed by ".", followed by the simple name of M. An array type has a fully qualified name if and only if its element type has a fully qualified name. In that case, the fully qualified name of an array type consists of the fully qualified name of the component type of the array type followed by "[]". Some examples how names will be translated
      java.lang.String getGenericCanonicalName()
      The canonical name with generic information.
      java.lang.String getGenericFullyQualifiedName()
      The fully qualified name with generic information.
      java.lang.String getGenericValue()
      A java5+ representation of the class.
      JavaClass getJavaClass()
      java.lang.String getName()
      java.lang.String getResolvedFullyQualifiedName()
      java.lang.String getResolvedGenericFullyQualifiedName()
      java.lang.String getResolvedGenericValue()
      java.lang.String getResolvedValue()
      JavaType getType()
      java.lang.String getValue()
      If there's a reference to this class, use the value used in the code.
      int hashCode()  
      boolean isVarArgs()
      Is this a Java 5 var args type specified using three dots.
      void setExecutable​(JavaExecutable executable)  
      void setName​(java.lang.String name)  
      java.lang.String toGenericString()
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        private java.lang.String name
      • varArgs

        private boolean varArgs
    • Constructor Detail

      • DefaultJavaParameter

        public DefaultJavaParameter​(JavaClass type,
                                    java.lang.String name)
      • DefaultJavaParameter

        public DefaultJavaParameter​(JavaClass type,
                                    java.lang.String name,
                                    boolean varArgs)
    • Method Detail

      • getCodeBlock

        public java.lang.String getCodeBlock()
        Specified by:
        getCodeBlock in interface JavaModel
        Returns:
        the codeblock
      • setName

        public void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface JavaParameter
        Returns:
        the name of the parameter
      • getExecutable

        public JavaExecutable getExecutable()
        Returns the declaring method or constructor of this parameter
        Specified by:
        getExecutable in interface JavaParameter
        Returns:
        the declaring method or constructor
      • setExecutable

        public void setExecutable​(JavaExecutable executable)
      • isVarArgs

        public boolean isVarArgs()
        Is this a Java 5 var args type specified using three dots. e.g. void doStuff(Object... thing)
        Specified by:
        isVarArgs in interface JavaParameter
        Returns:
        true if this parameter is a varArg, otherwise false
      • getBinaryName

        public java.lang.String getBinaryName()
        The class or interface must be named by its binary name, which must meet the following constraints:
        • The binary name of a top level type is its canonical name.
        • The binary name of a member type consists of the binary name of its immediately enclosing type, followed by $, followed by the simple name of the member.
        Specified by:
        getBinaryName in interface JavaType
        Returns:
        the binary name
        See Also:
        https://docs.oracle.com/javase/specs/jls/se8/html/jls-13.html#jls-13.1
      • getFullyQualifiedName

        public java.lang.String getFullyQualifiedName()
        Every primitive type, named package, top level class, and top level interface has a fully qualified name:
        • The fully qualified name of a primitive type is the keyword for that primitive type, namely byte, short, char, int, long, float, double, or boolean.
        • The fully qualified name of a named package that is not a subpackage of a named package is its simple name.
        • The fully qualified name of a named package that is a subpackage of another named package consists of the fully qualified name of the containing package, followed by ".", followed by the simple (member) name of the subpackage.
        • The fully qualified name of a top level class or top level interface that is declared in an unnamed package is the simple name of the class or interface.
        • The fully qualified name of a top level class or top level interface that is declared in a named package consists of the fully qualified name of the package, followed by ".", followed by the simple name of the class or interface.
        Each member class, member interface, and array type may have a fully qualified name:
        • A member class or member interface M of another class or interface C has a fully qualified name if and only if C has a fully qualified name.
        • In that case, the fully qualified name of M consists of the fully qualified name of C, followed by ".", followed by the simple name of M.
        • An array type has a fully qualified name if and only if its element type has a fully qualified name.
        • In that case, the fully qualified name of an array type consists of the fully qualified name of the component type of the array type followed by "[]".
        Some examples how names will be translated
         Object > java.lang.Object
         java.util.List > java.util.List
         ?  > ?
         T  > T
         anypackage.Outer.Inner > anypackage.Outer.Inner
         String[][] > java.lang.String[][]
         
        Specified by:
        getFullyQualifiedName in interface JavaParameter
        Specified by:
        getFullyQualifiedName in interface JavaType
        Returns:
        the FQN of the type, never null
        See Also:
        JavaClass.getComponentType(), JavaType.getBinaryName(), https://docs.oracle.com/javase/specs/jls/se8/html/jls-6.html#jls-6.7
      • getCanonicalName

        public java.lang.String getCanonicalName()
        Equivalent of (@link Class.getCanonicalName().
        Specified by:
        getCanonicalName in interface JavaParameter
        Specified by:
        getCanonicalName in interface JavaType
        Returns:
        the canonical name of the type, never null
      • getValue

        public java.lang.String getValue()
        If there's a reference to this class, use the value used in the code. Otherwise return the simple name. When including all imports, you should be safe to use this method. This won't return generics, so it's java1.4 safe. Examples:
          private String fieldA;             // getValue() will return "String"
          private java.lang.String fieldA;   // getValue() will return "java.lang.String"
          private List>String> aList;  // getValue() will return "List"
         
        Specified by:
        getValue in interface JavaParameter
        Specified by:
        getValue in interface JavaType
        Returns:
        the value of the type, never null
      • getGenericCanonicalName

        public java.lang.String getGenericCanonicalName()
        The canonical name with generic information.
        Specified by:
        getGenericCanonicalName in interface JavaType
        Returns:
        the generic canonical name
      • getGenericFullyQualifiedName

        public java.lang.String getGenericFullyQualifiedName()
        The fully qualified name with generic information.
        Specified by:
        getGenericFullyQualifiedName in interface JavaType
        Returns:
        the generic fully qualified name
      • getResolvedValue

        public java.lang.String getResolvedValue()
        Specified by:
        getResolvedValue in interface JavaParameter
        Returns:
        the resolved value of the type
      • getResolvedGenericValue

        public java.lang.String getResolvedGenericValue()
        Specified by:
        getResolvedGenericValue in interface JavaParameter
        Returns:
        the resolved generic value of the type, never null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getGenericValue

        public java.lang.String getGenericValue()
        A java5+ representation of the class. When including all imports, you should be safe to use this method. Examples:
          private String fieldA;             // getValue() will return "String"
          private java.lang.String fieldA;   // getValue() will return "java.lang.String"
          private List>String> aList;  // getValue() will return "List>String>"
         
        Specified by:
        getGenericValue in interface JavaType
        Returns:
        the generic name of the class as used in the source
      • toGenericString

        public java.lang.String toGenericString()
        Specified by:
        toGenericString in interface JavaType