JBoss Reflection 2.2.1.SP1

org.jboss.reflect.plugins.javassist.expr
Interface NewArray

All Superinterfaces:
Expression

public interface NewArray
extends Expression

A new array expression.

Version:
$Revision: 1.1 $
Author:
Stale W. Pedersen

Method Summary
 MutableClassInfo getComponentType()
          Returns the type of array components.
 int getCreatedDimensions()
          Returns the number of dimensions of the array being created.
 void replace(String statement)
          Replaces the array creation with the bytecode derived from the given source text.
 
Methods inherited from interface org.jboss.reflect.plugins.javassist.expr.Expression
getFileName, getLineNumber, indexOfBytecode, mayThrow, replace, whereConstructor, whereMethod
 

Method Detail

getComponentType

MutableClassInfo getComponentType()
                                  throws NotFoundException
Returns the type of array components. If the created array is a two-dimensional array of int, the type returned by this method is not int[] but int.

Returns:
the type of array components
Throws:
NotFoundException

getCreatedDimensions

int getCreatedDimensions()
Returns the number of dimensions of the array being created. If the opcode is multianewarray, this method returns the second operand. Otherwise, it returns 1.

Returns:
the number of dimensions of the array being created

replace

void replace(String statement)
             throws CannotCompileException
Replaces the array creation with the bytecode derived from the given source text.

Specified by:
replace in interface Expression
Throws:
CannotCompileException

JBoss Reflection 2.2.1.SP1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.