Package org.jboss.jdeparser
Class ArrayJType
- java.lang.Object
-
- org.jboss.jdeparser.AbstractJType
-
- org.jboss.jdeparser.ArrayJType
-
- All Implemented Interfaces:
JType
class ArrayJType extends AbstractJType
-
-
Constructor Summary
Constructors Constructor Description ArrayJType(AbstractJType elementType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JExpr
_class()
An expression of the formThisType.class
.JExpr
_new(JExpr dim)
Construct a new instance of this array type.JArrayExpr
_newArray()
Create a new array of this type which is inline-initialized.JType
elementType()
The element type, if this an array (otherwisenull
).(package private) boolean
equals(AbstractJType other)
int
hashCode()
(package private) java.lang.String
qualifiedName()
java.lang.String
simpleName()
Get the simple name of this type.java.lang.String
toString()
(package private) void
writeDirect(SourceFileWriter sourceFileWriter)
-
-
-
Field Detail
-
elementType
private final AbstractJType elementType
-
classExpr
private StaticRefJExpr classExpr
-
-
Constructor Detail
-
ArrayJType
ArrayJType(AbstractJType elementType)
-
-
Method Detail
-
elementType
public JType elementType()
Description copied from interface:JType
The element type, if this an array (otherwisenull
).- Specified by:
elementType
in interfaceJType
- Overrides:
elementType
in classAbstractJType
- Returns:
- the element type, or
null
if it is not an array
-
writeDirect
void writeDirect(SourceFileWriter sourceFileWriter) throws java.io.IOException
- Specified by:
writeDirect
in classAbstractJType
- Throws:
java.io.IOException
-
qualifiedName
java.lang.String qualifiedName()
- Overrides:
qualifiedName
in classAbstractJType
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classAbstractJType
-
equals
boolean equals(AbstractJType other)
- Specified by:
equals
in classAbstractJType
-
_new
public JExpr _new(JExpr dim)
Description copied from interface:JType
Construct a new instance of this array type. If the type is not an array type, an exception is thrown.- Specified by:
_new
in interfaceJType
- Overrides:
_new
in classAbstractJType
- Parameters:
dim
- the array size- Returns:
- the construction call
-
_newArray
public JArrayExpr _newArray()
Description copied from interface:JType
Create a new array of this type which is inline-initialized.- Specified by:
_newArray
in interfaceJType
- Overrides:
_newArray
in classAbstractJType
- Returns:
- the array, initially with zero elements
-
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
-
toString
public java.lang.String toString()
- Specified by:
toString
in classAbstractJType
-
-