1 29 30 package com.caucho.jmx; 31 32 import java.lang.reflect.Array ; 33 34 37 class UnmarshallArray extends Unmarshall { 38 private final Class _componentType; 39 private final Unmarshall _componentUnmarshall; 40 41 protected UnmarshallArray(Class componentType, 42 Unmarshall componentUnmarshall) 43 { 44 _componentType = componentType; 45 _componentUnmarshall = componentUnmarshall; 46 } 47 48 51 Object unmarshall(Object value) 52 { 53 if (value == null) 54 return value; 55 56 Object []array = (Object []) value; 57 58 Object []newArray = 59 (Object []) Array.newInstance(_componentType, array.length); 60 61 for (int i = 0; i < array.length; i++) { 62 newArray[i] = _componentUnmarshall.unmarshall(array[i]); 63 } 64 65 return newArray; 66 } 67 } 68 | Popular Tags |