if (refType.isAssignableFrom(CallableReferenceImpl.class)) {
implType = CallableReferenceImpl.class;
} else if (refType.isAssignableFrom(ServiceReferenceImpl.class)) {
implType = ServiceReferenceImpl.class;
} else {
throw new TransformationException("Unrecognized transformation target type");
}
Constructor constructor = implType.getConstructor(new Class[] {XMLStreamReader.class});
return (CallableReference)constructor.newInstance(new Object[] {source});
} else {
return null;
}
} catch (Exception e) {
throw new TransformationException(e);
}
}