Package com.thoughtworks.qdox.model.impl
Class DefaultJavaParameter
java.lang.Object
com.thoughtworks.qdox.model.impl.AbstractJavaModel
com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
com.thoughtworks.qdox.model.impl.DefaultJavaParameter
- All Implemented Interfaces:
JavaAnnotatedElement,JavaModel,JavaParameter,JavaType,Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JavaExecutableprivate Stringprivate JavaClassprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionDefaultJavaParameter(JavaClass type, String name) DefaultJavaParameter(JavaClass type, String name, boolean varArgs) -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe 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.Equivalent of (@linkClass.getCanonicalName().Not every entity has a parentClass, but AnnotationFieldRef requires access to it.Returns the declaring method or constructor of this parameterEvery 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 translatedThe canonical name with generic information.The fully qualified name with generic information.A java5+ representation of the class.getName()getType()getValue()If there's a reference to this class, use the value used in the code.inthashCode()booleanIs this a Java 5 var args type specified using three dots.voidsetExecutable(JavaExecutable executable) voidtoString()Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
getAnnotations, getComment, getNamedParameter, getSource, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTagsMethods inherited from class com.thoughtworks.qdox.model.impl.AbstractJavaModel
getLineNumber, getModelWriter, setLineNumber, setModelWriterFactoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.thoughtworks.qdox.model.JavaAnnotatedElement
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByNameMethods inherited from interface com.thoughtworks.qdox.model.JavaModel
getLineNumber
-
Field Details
-
name
-
type
-
executable
-
varArgs
private boolean varArgs
-
-
Constructor Details
-
DefaultJavaParameter
-
DefaultJavaParameter
-
-
Method Details
-
getCodeBlock
- Specified by:
getCodeBlockin interfaceJavaModel- Returns:
- the codeblock
-
setName
-
getName
- Specified by:
getNamein interfaceJavaParameter- Returns:
- the name of the parameter
-
getType
- Specified by:
getTypein interfaceJavaParameter- Returns:
- the type of this parameter
-
getJavaClass
- Specified by:
getJavaClassin interfaceJavaParameter
-
getExecutable
Returns the declaring method or constructor of this parameter- Specified by:
getExecutablein interfaceJavaParameter- Returns:
- the declaring method or constructor
-
setExecutable
-
getDeclaringClass
Not every entity has a parentClass, but AnnotationFieldRef requires access to it. When used with JavaClass, don't confuse this with getSuperClass()- Specified by:
getDeclaringClassin interfaceJavaParameter- Overrides:
getDeclaringClassin classAbstractBaseJavaEntity- Returns:
- the surrounding class
-
isVarArgs
public boolean isVarArgs()Is this a Java 5 var args type specified using three dots. e.g.void doStuff(Object... thing)- Specified by:
isVarArgsin interfaceJavaParameter- Returns:
trueif this parameter is a varArg, otherwisefalse
-
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:
getBinaryNamein interfaceJavaType- Returns:
- the binary name
- See Also:
-
getFullyQualifiedName
Every primitive type, named package, top level class, and top level interface has a fully qualified name:
Some examples how names will be translated- 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[][]
- Specified by:
getFullyQualifiedNamein interfaceJavaParameter- Specified by:
getFullyQualifiedNamein interfaceJavaType- Returns:
- the FQN of the type, never
null - See Also:
-
getCanonicalName
Equivalent of (@linkClass.getCanonicalName().- Specified by:
getCanonicalNamein interfaceJavaParameter- Specified by:
getCanonicalNamein interfaceJavaType- Returns:
- the canonical name of the type, never
null
-
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:
getValuein interfaceJavaParameter- Specified by:
getValuein interfaceJavaType- Returns:
- the value of the type, never
null
-
getGenericCanonicalName
The canonical name with generic information.- Specified by:
getGenericCanonicalNamein interfaceJavaType- Returns:
- the generic canonical name
-
getGenericFullyQualifiedName
The fully qualified name with generic information.- Specified by:
getGenericFullyQualifiedNamein interfaceJavaType- Returns:
- the generic fully qualified name
-
getResolvedValue
- Specified by:
getResolvedValuein interfaceJavaParameter- Returns:
- the resolved value of the type
-
getResolvedFullyQualifiedName
- Specified by:
getResolvedFullyQualifiedNamein interfaceJavaParameter- Returns:
- the resolved FQN, never
null
-
getResolvedGenericValue
- Specified by:
getResolvedGenericValuein interfaceJavaParameter- Returns:
- the resolved generic value of the type, never
null
-
getResolvedGenericFullyQualifiedName
- Specified by:
getResolvedGenericFullyQualifiedNamein interfaceJavaParameter- Returns:
- the resolved generic FQN, never
null
-
hashCode
public int hashCode() -
equals
-
toString
-
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:
getGenericValuein interfaceJavaType- Returns:
- the generic name of the class as used in the source
-
toGenericString
- Specified by:
toGenericStringin interfaceJavaType
-