Package org.jboss.jdeparser
Class ReferenceJType
- java.lang.Object
-
- org.jboss.jdeparser.AbstractJType
-
- org.jboss.jdeparser.ReferenceJType
-
- All Implemented Interfaces:
JType
class ReferenceJType extends AbstractJType
-
-
Field Summary
Fields Modifier and Type Field Description private StaticRefJExpr
classExpr
private CachingLinkedHashMap<java.lang.String,NestedJType>
nestedTypes
private java.lang.String
packageName
private java.lang.String
simpleName
private StaticRefJExpr
superExpr
private StaticRefJExpr
thisExpr
private PrimitiveJType
unboxed
-
Constructor Summary
Constructors Constructor Description ReferenceJType(java.lang.String packageName, java.lang.String simpleName)
ReferenceJType(java.lang.String packageName, java.lang.String simpleName, PrimitiveJType unboxed)
-
Method Summary
All Methods Static Methods Instance 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.JAnonymousClassDef
_newAnon()
Construct a new anonymous subclass of this type.JExpr
_super()
An expression of the formThisType.super
.JExpr
_this()
An expression of the formThisType.this
.(package private) boolean
equals(AbstractJType other)
private boolean
equals(ReferenceJType other)
int
hashCode()
JType
nestedType(java.lang.String name)
Get a nested type within this reference type.(package private) static ReferenceJType
of(JType type)
(package private) java.lang.String
qualifiedName()
java.lang.String
simpleName()
Get the simple name of this type.java.lang.String
toString()
JType
typeArg(JType... args)
This type, with the given generic type arguments.JType
unbox()
The primitive-unboxed version of this type.(package private) void
writeDirect(SourceFileWriter sourceFileWriter)
-
-
-
Field Detail
-
unboxed
private final PrimitiveJType unboxed
-
packageName
private final java.lang.String packageName
-
simpleName
private final java.lang.String simpleName
-
classExpr
private StaticRefJExpr classExpr
-
thisExpr
private StaticRefJExpr thisExpr
-
superExpr
private StaticRefJExpr superExpr
-
nestedTypes
private CachingLinkedHashMap<java.lang.String,NestedJType> nestedTypes
-
-
Constructor Detail
-
ReferenceJType
ReferenceJType(java.lang.String packageName, java.lang.String simpleName)
-
ReferenceJType
ReferenceJType(java.lang.String packageName, java.lang.String simpleName, PrimitiveJType unboxed)
-
-
Method Detail
-
of
static ReferenceJType of(JType type)
-
qualifiedName
java.lang.String qualifiedName()
- Overrides:
qualifiedName
in classAbstractJType
-
simpleName
public java.lang.String simpleName()
Description copied from interface:JType
Get the simple name of this type.- Specified by:
simpleName
in interfaceJType
- Specified by:
simpleName
in classAbstractJType
- Returns:
- the type's simple name
-
_class
public JExpr _class()
Description copied from interface:JType
An expression of the formThisType.class
.- Specified by:
_class
in interfaceJType
- Overrides:
_class
in classAbstractJType
- Returns:
- the expression
-
_this
public JExpr _this()
Description copied from interface:JType
An expression of the formThisType.this
. If the type is an array type, an exception is thrown.- Specified by:
_this
in interfaceJType
- Overrides:
_this
in classAbstractJType
- Returns:
- the expression
-
_super
public JExpr _super()
Description copied from interface:JType
An expression of the formThisType.super
. If the type is an array type, an exception is thrown.- Specified by:
_super
in interfaceJType
- Overrides:
_super
in classAbstractJType
- Returns:
- the expression
-
_new
public JCall _new()
Description copied from interface:JType
Construct a new instance of this non-array type. If the type is an array type, an exception is thrown.- Specified by:
_new
in interfaceJType
- Overrides:
_new
in classAbstractJType
- Returns:
- the construction call
-
_newAnon
public JAnonymousClassDef _newAnon()
Description copied from interface:JType
Construct a new anonymous subclass of this type.- Specified by:
_newAnon
in interfaceJType
- Overrides:
_newAnon
in classAbstractJType
- Returns:
- the anonymous subclass definition
-
unbox
public JType unbox()
Description copied from interface:JType
The primitive-unboxed version of this type.- Specified by:
unbox
in interfaceJType
- Overrides:
unbox
in classAbstractJType
- Returns:
- the unboxed version of this type
-
writeDirect
void writeDirect(SourceFileWriter sourceFileWriter) throws java.io.IOException
- Specified by:
writeDirect
in classAbstractJType
- Throws:
java.io.IOException
-
typeArg
public JType typeArg(JType... args)
Description copied from interface:JType
This type, with the given generic type arguments.- Specified by:
typeArg
in interfaceJType
- Overrides:
typeArg
in classAbstractJType
- Parameters:
args
- the type arguments- Returns:
- the generic type
-
nestedType
public JType nestedType(java.lang.String name)
Description copied from interface:JType
Get a nested type within this reference type.- Specified by:
nestedType
in interfaceJType
- Overrides:
nestedType
in classAbstractJType
- Parameters:
name
- the name of the nested type- Returns:
- the nested type
-
equals
boolean equals(AbstractJType other)
- Specified by:
equals
in classAbstractJType
-
equals
private boolean equals(ReferenceJType other)
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classAbstractJType
-
toString
public java.lang.String toString()
- Specified by:
toString
in classAbstractJType
-
-