Package org.jboss.jdeparser
Class AbstractJType
- java.lang.Object
-
- org.jboss.jdeparser.AbstractJType
-
- All Implemented Interfaces:
JType
- Direct Known Subclasses:
ArrayJType,NarrowedJType,NestedJType,PrimitiveJType,ReferenceJType,ThisJType,WildcardJType
abstract class AbstractJType extends java.lang.Object implements JType
-
-
Field Summary
Fields Modifier and Type Field Description private ArrayJTypearrayprivate CachingLinkedHashMap<java.lang.String,JAssignableExpr>staticRefsprivate WildcardJTypewildcardExtendsprivate WildcardJTypewildcardSuper
-
Constructor Summary
Constructors Constructor Description AbstractJType()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description JExpr_class()An expression of the formThisType.class.JCall_new()Construct a new instance of this non-array type.JExpr_new(int dim)Construct a new instance of this array type.JExpr_new(JExpr dim)Construct a new instance of this array type.JAnonymousClassDef_newAnon()Construct a new anonymous subclass of this type.JArrayExpr_newArray()Create a new array of this type which is inline-initialized.JExpr_super()An expression of the formThisType.super.JExpr_this()An expression of the formThisType.this.JType$t(java.lang.String name)Get a nested type within this reference type.JAssignableExpr$v(java.lang.String name)Look up a static field on this type.JTypearray()An array of this type.JTypebox()The primitive-boxed version of this type.JCallcall(java.lang.String name)Call a static method on this type.JCallcall(javax.lang.model.element.ExecutableElement method)Call a static method on this type.JTypeelementType()The element type, if this an array (otherwisenull).booleanequals(java.lang.Object other)(package private) abstract booleanequals(AbstractJType other)JTypeerasure()The erasure of this type.JAssignableExprfield(java.lang.String name)Look up a static field on this type.abstract inthashCode()JExprmethodRef(java.lang.String name)Get a method reference of this type.JExprmethodRef(javax.lang.model.element.ExecutableElement method)Get a method reference of this type.JTypenestedType(java.lang.String name)Get a nested type within this reference type.(package private) static AbstractJTypeof(JType type)(package private) java.lang.StringqualifiedName()abstract java.lang.StringsimpleName()Get the simple name of this type.abstract java.lang.StringtoString()JTypetypeArg(java.lang.Class<?>... args)This type, with the given generic type arguments.JTypetypeArg(java.lang.String... args)This type, with the given generic type arguments.JTypetypeArg(JType... args)This type, with the given generic type arguments.JType[]typeArgs()Get the type arguments of this type.JTypeunbox()The primitive-unboxed version of this type.JTypewildcardExtends()Get a wildcard that extends this type.JTypewildcardSuper()Get a wildcard that this type extends.(package private) abstract voidwriteDirect(SourceFileWriter sourceFileWriter)
-
-
-
Field Detail
-
array
private ArrayJType array
-
wildcardExtends
private WildcardJType wildcardExtends
-
wildcardSuper
private WildcardJType wildcardSuper
-
staticRefs
private CachingLinkedHashMap<java.lang.String,JAssignableExpr> staticRefs
-
-
Method Detail
-
of
static AbstractJType of(JType type)
-
qualifiedName
java.lang.String qualifiedName()
-
hashCode
public abstract int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
equals
abstract boolean equals(AbstractJType other)
-
simpleName
public abstract java.lang.String simpleName()
Description copied from interface:JTypeGet the simple name of this type.- Specified by:
simpleNamein interfaceJType- Returns:
- the type's simple name
-
toString
public abstract java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
_class
public JExpr _class()
Description copied from interface:JTypeAn expression of the formThisType.class.
-
_this
public JExpr _this()
Description copied from interface:JTypeAn expression of the formThisType.this. If the type is an array type, an exception is thrown.
-
_super
public JExpr _super()
Description copied from interface:JTypeAn expression of the formThisType.super. If the type is an array type, an exception is thrown.
-
_new
public JCall _new()
Description copied from interface:JTypeConstruct a new instance of this non-array type. If the type is an array type, an exception is thrown.
-
_new
public JExpr _new(JExpr dim)
Description copied from interface:JTypeConstruct a new instance of this array type. If the type is not an array type, an exception is thrown.
-
_new
public JExpr _new(int dim)
Description copied from interface:JTypeConstruct a new instance of this array type. If the type is not an array type, an exception is thrown.
-
_newArray
public JArrayExpr _newArray()
Description copied from interface:JTypeCreate a new array of this type which is inline-initialized.
-
_newAnon
public JAnonymousClassDef _newAnon()
Description copied from interface:JTypeConstruct a new anonymous subclass of this type.
-
typeArg
public JType typeArg(java.lang.String... args)
Description copied from interface:JTypeThis type, with the given generic type arguments.
-
typeArg
public JType typeArg(JType... args)
Description copied from interface:JTypeThis type, with the given generic type arguments.
-
typeArg
public JType typeArg(java.lang.Class<?>... args)
Description copied from interface:JTypeThis type, with the given generic type arguments.
-
typeArgs
public JType[] typeArgs()
Description copied from interface:JTypeGet the type arguments of this type.
-
elementType
public JType elementType()
Description copied from interface:JTypeThe element type, if this an array (otherwisenull).- Specified by:
elementTypein interfaceJType- Returns:
- the element type, or
nullif it is not an array
-
box
public JType box()
Description copied from interface:JTypeThe primitive-boxed version of this type.
-
unbox
public JType unbox()
Description copied from interface:JTypeThe primitive-unboxed version of this type.
-
wildcardExtends
public JType wildcardExtends()
Description copied from interface:JTypeGet a wildcard that extends this type.- Specified by:
wildcardExtendsin interfaceJType- Returns:
- the wildcard
-
wildcardSuper
public JType wildcardSuper()
Description copied from interface:JTypeGet a wildcard that this type extends.- Specified by:
wildcardSuperin interfaceJType- Returns:
- the wildcard
-
nestedType
public JType nestedType(java.lang.String name)
Description copied from interface:JTypeGet a nested type within this reference type.- Specified by:
nestedTypein interfaceJType- Parameters:
name- the name of the nested type- Returns:
- the nested type
-
$t
public JType $t(java.lang.String name)
Description copied from interface:JTypeGet a nested type within this reference type.
-
field
public JAssignableExpr field(java.lang.String name)
Description copied from interface:JTypeLook up a static field on this type.
-
$v
public JAssignableExpr $v(java.lang.String name)
Description copied from interface:JTypeLook up a static field on this type.
-
call
public JCall call(java.lang.String name)
Description copied from interface:JTypeCall a static method on this type.
-
call
public JCall call(javax.lang.model.element.ExecutableElement method)
Description copied from interface:JTypeCall a static method on this type.
-
methodRef
public JExpr methodRef(java.lang.String name)
Description copied from interface:JTypeGet a method reference of this type.
-
methodRef
public JExpr methodRef(javax.lang.model.element.ExecutableElement method)
Description copied from interface:JTypeGet a method reference of this type.
-
writeDirect
abstract void writeDirect(SourceFileWriter sourceFileWriter) throws java.io.IOException
- Throws:
java.io.IOException
-
-