final EdsPoint data = CanonUtils.getPropertyDataAdvanced( baseRef, property, param );
result = (T) data;
break;
}
case kEdsDataType_Rect: { //EdsRect
final EdsRect data = CanonUtils.getPropertyDataAdvanced( baseRef, property, param );
result = (T) data;
break;
}
case kEdsDataType_Time: { //EdsTime
final EdsTime data = CanonUtils.getPropertyDataAdvanced( baseRef, property, param );
result = (T) data;
break;
}
case kEdsDataType_FocusInfo: { //EdsFocusInfo
final EdsFocusInfo data = CanonUtils.getPropertyDataAdvanced( baseRef, property, param );
result = (T) data;
break;
}
case kEdsDataType_PictureStyleDesc: { //EdsPictureStyleDesc
final EdsPictureStyleDesc data = CanonUtils.getPropertyDataAdvanced( baseRef, property, param );
result = (T) data;
break;
}
case kEdsDataType_ByteBlock: //EdsUInt32[]
case kEdsDataType_Int32_Array: //EdsInt32[]
case kEdsDataType_UInt32_Array: { //EdsUInt32[]
final int[] data = CanonUtils.getPropertyDataAdvanced( baseRef, property, param );
if ( data != null ) {
if ( klass != null &&
DescriptiveEnum[].class.isAssignableFrom( klass ) ) {
// DescriptiveEnum[]
final DescriptiveEnum<?>[] array = (DescriptiveEnum<?>[]) Array.newInstance( klass.getComponentType(), data.length );
for ( int i = 0; i < data.length; i++ ) {
array[i] = CanonConstants.enumOfValue( (Class<? extends DescriptiveEnum<?>>) klass.getComponentType(), data[i] );
}
result = (T) array;
} else if ( klass != null &&
DescriptiveEnum.class.isAssignableFrom( klass ) ) {
// DescriptiveEnum
if ( data.length > 1 ) {
throw new IllegalStateException( "Only single result expected but multiple results returned!" );
}
result = (T) CanonConstants.enumOfValue( (Class<? extends DescriptiveEnum<?>>) klass, data[0] );
} else if ( klass != null &&
EdsRect.class.isAssignableFrom( klass ) ) {
// EdsRect
if ( data.length != 4 ) {
throw new IllegalStateException( "Four values expected for an EdsRect!" );
}
result = (T) new EdsRect( new EdsPoint( new NativeLong( data[0] ), new NativeLong( data[1] ) ), new EdsSize( new NativeLong( data[2] ), new NativeLong( data[3] ) ) );
} else if ( klass != null &&
EdsSize.class.isAssignableFrom( klass ) ) {
// EdsSize
if ( data.length != 2 ) {
throw new IllegalStateException( "Two values expected for an EdsSize!" );