public class DefaultJavaParameter extends AbstractBaseJavaEntity implements JavaParameter
| Constructor and Description |
|---|
DefaultJavaParameter(JavaClass type,
java.lang.String name) |
DefaultJavaParameter(JavaClass type,
java.lang.String name,
boolean varArgs) |
| Modifier and Type | Method and 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.
|
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.
|
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. e.g.
|
void |
setExecutable(JavaExecutable executable) |
void |
setName(java.lang.String name) |
java.lang.String |
toGenericString() |
java.lang.String |
toString() |
getAnnotations, getComment, getNamedParameter, getSource, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTagsgetLineNumber, getModelWriter, setLineNumber, setModelWriterFactoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByNamegetLineNumberpublic DefaultJavaParameter(JavaClass type, java.lang.String name)
public DefaultJavaParameter(JavaClass type, java.lang.String name, boolean varArgs)
public java.lang.String getCodeBlock()
getCodeBlock in interface JavaModelpublic void setName(java.lang.String name)
public java.lang.String getName()
getName in interface JavaParameterpublic JavaType getType()
getType in interface JavaParameterpublic JavaClass getJavaClass()
getJavaClass in interface JavaParameterpublic JavaExecutable getExecutable()
getExecutable in interface JavaParameterpublic void setExecutable(JavaExecutable executable)
public JavaClass getDeclaringClass()
getDeclaringClass in interface JavaParametergetDeclaringClass in class AbstractBaseJavaEntitypublic boolean isVarArgs()
void doStuff(Object... thing)isVarArgs in interface JavaParametertrue if this parameter is a varArg, otherwise falsepublic 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.
getBinaryName in interface JavaTypepublic java.lang.String getFullyQualifiedName()
Every primitive type, named package, top level class, and top level interface has a fully qualified name:Some examples how names will be translatedEach member class, member interface, and array type may have 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.
- 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 "[]".
Object > java.lang.Object java.util.List > java.util.List ? > ? T > T anypackage.Outer.Inner > anypackage.Outer.Inner String[][] > java.lang.String[][]
getFullyQualifiedName in interface JavaParametergetFullyQualifiedName in interface JavaTypenullJavaClass.getComponentType(),
JavaType.getBinaryName(),
https://docs.oracle.com/javase/specs/jls/se8/html/jls-6.html#jls-6.7public java.lang.String getCanonicalName()
Class.getCanonicalName().getCanonicalName in interface JavaParametergetCanonicalName in interface JavaTypenullpublic java.lang.String getValue()
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"
getValue in interface JavaParametergetValue in interface JavaTypenullpublic java.lang.String getGenericCanonicalName()
getGenericCanonicalName in interface JavaTypepublic java.lang.String getGenericFullyQualifiedName()
getGenericFullyQualifiedName in interface JavaTypepublic java.lang.String getResolvedValue()
getResolvedValue in interface JavaParameterpublic java.lang.String getResolvedFullyQualifiedName()
getResolvedFullyQualifiedName in interface JavaParameternullpublic java.lang.String getResolvedGenericValue()
getResolvedGenericValue in interface JavaParameternullpublic java.lang.String getResolvedGenericFullyQualifiedName()
getResolvedGenericFullyQualifiedName in interface JavaParameternullpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getGenericValue()
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>"
getGenericValue in interface JavaTypepublic java.lang.String toGenericString()
toGenericString in interface JavaTypeCopyright © 2002-2018. All Rights Reserved.