/** * Finds the field specified by <code>fieldName</code> in * the type hierarchy denoted by the given type. Returns <code>null</code> if no such field * exists. If the field is defined in more than one super type only the first match is * returned. First the super class is examined and then the implemented interfaces. * @param type The type to search the field in * @param fieldName The name of the field to find * @return the variable binding representing the field */ public static IVariableBinding findFieldInHierarchy(ITypeBinding type, String fieldName) { IVariableBinding field= findFieldInType(type, fieldName); if (field != null) return field; ITypeBinding superClass= type.getSuperclass(); if (superClass != null) { field= findFieldInHierarchy(superClass, fieldName); if (field != null) return field; } ITypeBinding[] interfaces= type.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { field= findFieldInHierarchy(interfaces[i], fieldName); if (field != null) // no private fields in interfaces return field; } return null; }
/** * Finds the field specified by <code>fieldName</code> in * the type hierarchy denoted by the given type. Returns <code>null</code> if no such field * exists. If the field is defined in more than one super type only the first match is * returned. First the super class is examined and than the implemented interfaces. * @param type The type to search the field in * @param fieldName The name of the field to find * @return the variable binding representing the field */ public static IVariableBinding findFieldInHierarchy(ITypeBinding type, String fieldName) { IVariableBinding field= findFieldInType(type, fieldName); if (field != null) return field; ITypeBinding superClass= type.getSuperclass(); if (superClass != null) { field= findFieldInHierarchy(superClass, fieldName); if (field != null) return field; } ITypeBinding[] interfaces= type.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { field= findFieldInHierarchy(interfaces[i], fieldName); if (field != null) // no private fields in interfaces return field; } return null; }
/** * Finds the field specified by <code>fieldName</code> in * the type hierarchy denoted by the given type. Returns <code>null</code> if no such field * exists. If the field is defined in more than one super type only the first match is * returned. First the super class is examined and then the implemented interfaces. * @param type The type to search the field in * @param fieldName The name of the field to find * @return the variable binding representing the field */ public static IVariableBinding findFieldInHierarchy(ITypeBinding type, String fieldName) { IVariableBinding field= findFieldInType(type, fieldName); if (field != null) return field; ITypeBinding superClass= type.getSuperclass(); if (superClass != null) { field= findFieldInHierarchy(superClass, fieldName); if (field != null) return field; } ITypeBinding[] interfaces= type.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { field= findFieldInHierarchy(interfaces[i], fieldName); if (field != null) // no private fields in interfaces return field; } return null; }
return; IVariableBinding fieldBinding= Bindings.findFieldInHierarchy(typeBinding, binding.getName()); if (fieldBinding == null || fieldBinding.getDeclaringClass() != typeBinding && Modifier.isPrivate(fieldBinding.getModifiers())) { return;
return; IVariableBinding fieldBinding= Bindings.findFieldInHierarchy(typeBinding, binding.getName()); if (fieldBinding == null || fieldBinding.getDeclaringClass() != typeBinding && Modifier.isPrivate(fieldBinding.getModifiers())) { return;
return; IVariableBinding fieldBinding= Bindings.findFieldInHierarchy(typeBinding, binding.getName()); if (fieldBinding == null || fieldBinding.getDeclaringClass() != typeBinding && Modifier.isPrivate(fieldBinding.getModifiers())) { return;
return false; } else if (Bindings.findFieldInHierarchy(castType, accessSelector.getIdentifier()) == null) { return false;
return false; } else if (Bindings.findFieldInHierarchy(castType, accessSelector.getIdentifier()) == null) { return false;
return false; } else if (Bindings.findFieldInHierarchy(castType, accessSelector.getIdentifier()) == null) { return false;
return false; } else if (Bindings.findFieldInHierarchy(castType, accessSelector.getIdentifier()) == null) { return false;
return false; } else if (Bindings.findFieldInHierarchy(castType, accessSelector.getIdentifier()) == null) { return false;
ITypeBinding enclosingType= ASTNodes.getEnclosingType(node); if (enclosingType != null) { IVariableBinding fieldInHierarchy= Bindings.findFieldInHierarchy(enclosingType, node.getIdentifier()); if (fieldInHierarchy != null) { targetType= enclosingType;
ITypeBinding enclosingType= ASTNodes.getEnclosingType(node); if (enclosingType != null) { IVariableBinding fieldInHierarchy= Bindings.findFieldInHierarchy(enclosingType, node.getIdentifier()); if (fieldInHierarchy != null) { targetType= enclosingType;