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.JTypeelementType()The element type, if this an array (otherwisenull).(package private) booleanequals(AbstractJType other)inthashCode()(package private) java.lang.StringqualifiedName()java.lang.StringsimpleName()Get the simple name of this type.java.lang.StringtoString()(package private) voidwriteDirect(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:JTypeThe element type, if this an array (otherwisenull).- Specified by:
elementTypein interfaceJType- Overrides:
elementTypein classAbstractJType- Returns:
- the element type, or
nullif it is not an array
-
writeDirect
void writeDirect(SourceFileWriter sourceFileWriter) throws java.io.IOException
- Specified by:
writeDirectin classAbstractJType- Throws:
java.io.IOException
-
qualifiedName
java.lang.String qualifiedName()
- Overrides:
qualifiedNamein classAbstractJType
-
hashCode
public int hashCode()
- Specified by:
hashCodein classAbstractJType
-
equals
boolean equals(AbstractJType other)
- Specified by:
equalsin classAbstractJType
-
_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.- Specified by:
_newin interfaceJType- Overrides:
_newin classAbstractJType- Parameters:
dim- the array size- Returns:
- the construction call
-
_newArray
public JArrayExpr _newArray()
Description copied from interface:JTypeCreate a new array of this type which is inline-initialized.- Specified by:
_newArrayin interfaceJType- Overrides:
_newArrayin classAbstractJType- Returns:
- the array, initially with zero elements
-
simpleName
public java.lang.String simpleName()
Description copied from interface:JTypeGet the simple name of this type.- Specified by:
simpleNamein interfaceJType- Specified by:
simpleNamein classAbstractJType- Returns:
- the type's simple name
-
toString
public java.lang.String toString()
- Specified by:
toStringin classAbstractJType
-
-