Package com.thoughtworks.qdox.model.impl
Class DefaultJavaWildcardType
- java.lang.Object
-
- com.thoughtworks.qdox.model.impl.DefaultJavaType
-
- com.thoughtworks.qdox.model.impl.DefaultJavaWildcardType
-
- All Implemented Interfaces:
JavaAnnotatedElement
,JavaClass
,JavaGenericDeclaration
,JavaModel
,JavaType
,JavaWildcardType
,java.io.Serializable
public class DefaultJavaWildcardType extends DefaultJavaType implements JavaWildcardType
Equivalent ofWildcardType
This class supports both the 'super' and 'extends' wildcards. For <?> you must use the normal Type, because ? itself can't be generic- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultJavaWildcardType.BoundType
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<JavaType>
bounds
private DefaultJavaWildcardType.BoundType
boundType
-
Fields inherited from class com.thoughtworks.qdox.model.impl.DefaultJavaType
fullName, name
-
-
Constructor Summary
Constructors Constructor Description DefaultJavaWildcardType()
DefaultJavaWildcardType(JavaType type, DefaultJavaWildcardType.BoundType boundType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCanonicalName()
Equivalent of (@linkClass.getCanonicalName()
.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 translatedjava.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.private java.lang.StringBuilder
getPreparedStringBuilder()
java.lang.String
getValue()
If there's a reference to this class, use the value used in the code.java.lang.String
toGenericString()
Returns getGenericValue() extended with the array information-
Methods inherited from class com.thoughtworks.qdox.model.impl.DefaultJavaType
equals, getAnnotations, getBeanProperties, getBeanProperties, getBeanProperty, getBeanProperty, getBinaryName, getCodeBlock, getComment, getComponentType, getConstructor, getConstructor, getConstructors, getDeclaringClass, getDerivedClasses, getDimensions, getEnumConstantByName, getEnumConstants, getFieldByName, getFields, getGenericValue, getImplements, getInitializers, getInterfaces, getJavaClassLibrary, getLineNumber, getMethod, getMethodBySignature, getMethodBySignature, getMethodBySignature, getMethods, getMethods, getMethodsBySignature, getMethodsBySignature, getModifiers, getName, getNamedParameter, getNestedClassByName, getNestedClasses, getPackage, getPackageName, getParentSource, getResolvedFullyQualifiedName, getResolvedGenericFullyQualifiedName, getResolvedGenericValue, getResolvedValue, getSimpleName, getSource, getSuperClass, getSuperJavaClass, getTagByName, getTags, getTagsByName, getTagsByName, getTypeParameters, hashCode, isA, isA, isA, isAbstract, isAnnotation, isArray, isEnum, isFinal, isInner, isInterface, isPrimitive, isPrivate, isProtected, isPublic, isResolved, isStatic, isVoid, resolve, resolve, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.thoughtworks.qdox.model.JavaType
getBinaryName
-
-
-
-
Field Detail
-
boundType
private DefaultJavaWildcardType.BoundType boundType
-
bounds
private java.util.List<JavaType> bounds
-
-
Constructor Detail
-
DefaultJavaWildcardType
public DefaultJavaWildcardType()
-
DefaultJavaWildcardType
public DefaultJavaWildcardType(JavaType type, DefaultJavaWildcardType.BoundType boundType)
-
-
Method Detail
-
getFullyQualifiedName
public java.lang.String getFullyQualifiedName()
Description copied from class:DefaultJavaType
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:
getFullyQualifiedName
in interfaceJavaType
- Overrides:
getFullyQualifiedName
in classDefaultJavaType
- Returns:
- the fully qualified name, never
null
- See Also:
JavaClass.getComponentType()
,JavaType.getBinaryName()
, https://docs.oracle.com/javase/specs/jls/se8/html/jls-6.html#jls-6.7
-
getGenericValue
public java.lang.String getGenericValue()
Description copied from class:DefaultJavaType
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 interfaceJavaType
- Overrides:
getGenericValue
in classDefaultJavaType
- Returns:
- the generic name of the class as used in the source
-
getGenericFullyQualifiedName
public java.lang.String getGenericFullyQualifiedName()
Description copied from class:DefaultJavaType
The fully qualified name with generic information.- Specified by:
getGenericFullyQualifiedName
in interfaceJavaType
- Overrides:
getGenericFullyQualifiedName
in classDefaultJavaType
- Returns:
- the generic fully qualified name
-
getCanonicalName
public java.lang.String getCanonicalName()
Description copied from class:DefaultJavaType
Equivalent of (@linkClass.getCanonicalName()
.- Specified by:
getCanonicalName
in interfaceJavaType
- Overrides:
getCanonicalName
in classDefaultJavaType
- Returns:
- the canonical name of this class
-
getGenericCanonicalName
public java.lang.String getGenericCanonicalName()
Description copied from class:DefaultJavaType
The canonical name with generic information.- Specified by:
getGenericCanonicalName
in interfaceJavaType
- Overrides:
getGenericCanonicalName
in classDefaultJavaType
- Returns:
- the generic canonical name
-
getValue
public java.lang.String getValue()
Description copied from class:DefaultJavaType
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 interfaceJavaType
- Overrides:
getValue
in classDefaultJavaType
- Returns:
- the name of the class as used in the source
-
toGenericString
public java.lang.String toGenericString()
Description copied from class:DefaultJavaType
Returns getGenericValue() extended with the array informationObject > java.lang.Object Object[] > java.lang.Object[] List<Object> > java.lang.List<java.lang.Object> Outer.Inner > Outer$Inner Outer.Inner<Object>[][] > Outer$Inner<java.lang.Object>[][]
- Specified by:
toGenericString
in interfaceJavaType
- Overrides:
toGenericString
in classDefaultJavaType
- Returns:
- a generic string representation of this type.
-
getPreparedStringBuilder
private java.lang.StringBuilder getPreparedStringBuilder()
-
-