* @return The adapter type, or null if none was specified.
*/
public static AdapterType findAdapterType(Declaration declaration) {
if (declaration instanceof Accessor) {
//jaxb accessor can be adapted.
Accessor accessor = ((Accessor) declaration);
return findAdapterType(accessor.getAccessorType(), accessor, accessor.getDeclaringType().getPackage());
}
else if (declaration instanceof MethodDeclaration) {
//assume the return type of the method is adaptable (e.g. web results, fault bean getters).
MethodDeclaration method = ((MethodDeclaration) declaration);
return findAdapterType(method.getReturnType(), method, method.getDeclaringType().getPackage());