org.jboss.aop.array
Interface ArrayReference

All Known Implementing Classes:
ArrayReferenceImpl

public interface ArrayReference

Contains information about one reference to a particular array.

Version:
$Revision: 1.1 $
Author:
Kabir Khan

Method Summary
 List<Integer> getNestedArrayIndices()
          If the root field is a direct reference to the array this will be null.
 String getRootField()
           
 Object getRootObject()
           
 

Method Detail

getRootObject

Object getRootObject()
Returns:
The object containing the field with the array reference. If the root field is non static this will be the reference of the instance, if the field is static it will be the class

getRootField

String getRootField()
Returns:
The field with the array reference

getNestedArrayIndices

List<Integer> getNestedArrayIndices()
If the root field is a direct reference to the array this will be null. If the field is an array and the reference is from within a nested array, this will be a list of the indexes from the top to get to the array.
So if we have:
 class POJO{
   int[] i;
 }
 POJO pojo = new POJO();
 int[] i arr = new int[]{1};
 pojo.i = arr;
 
getNestedArrayIndices will be null for arr.If we have:
 class POJO{
   int[][][] i;
 }
 POJO pojo = new POJO();
 int[] arr = new int[]{1};
 pojo.i = new int[][][]{new int[][]{new int[]{1}}, new int[][]{new int[]{2}, new int[]{3}, arr}};
 
getNestedArrayIndices will {1,2} for arr.



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