Exemplo n.º 1
0
 public String getNewSetterName() throws CoreException {
   return GetterSetterUtil.getSetterName(
       fField.getJavaProject(),
       getNewElementName(),
       fField.getFlags(),
       JavaModelUtil.isBoolean(fField),
       null);
 }
Exemplo n.º 2
0
 public String getNewGetterName() throws CoreException {
   IMethod primaryGetterCandidate =
       JavaModelUtil.findMethod(
           GetterSetterUtil.getGetterName(fField, new String[0]),
           new String[0],
           false,
           fField.getDeclaringType());
   if (!JavaModelUtil.isBoolean(fField)
       || (primaryGetterCandidate != null && primaryGetterCandidate.exists()))
     return GetterSetterUtil.getGetterName(
         fField.getJavaProject(),
         getNewElementName(),
         fField.getFlags(),
         JavaModelUtil.isBoolean(fField),
         null);
   // bug 30906 describes why we need to look for other alternatives here
   return GetterSetterUtil.getGetterName(
       fField.getJavaProject(), getNewElementName(), fField.getFlags(), false, null);
 }
 private static String getGetterName(
     IField field, String[] excludedNames, boolean useIsForBoolGetters) throws JavaModelException {
   if (excludedNames == null) {
     excludedNames = EMPTY;
   }
   return getGetterName(
       field.getJavaProject(),
       field.getElementName(),
       field.getFlags(),
       useIsForBoolGetters && JavaModelUtil.isBoolean(field),
       excludedNames);
 }
 public static IMethod getGetter(IField field) throws JavaModelException {
   String getterName = getGetterName(field, EMPTY, true);
   IMethod primaryCandidate =
       JavaModelUtil.findMethod(getterName, new String[0], false, field.getDeclaringType());
   if (!JavaModelUtil.isBoolean(field) || (primaryCandidate != null && primaryCandidate.exists()))
     return primaryCandidate;
   // bug 30906 describes why we need to look for other alternatives here (try with get... for
   // booleans)
   String secondCandidateName = getGetterName(field, EMPTY, false);
   return JavaModelUtil.findMethod(
       secondCandidateName, new String[0], false, field.getDeclaringType());
 }
 public static String getSetterName(IField field, String[] excludedNames)
     throws JavaModelException {
   if (excludedNames == null) {
     excludedNames = EMPTY;
   }
   return getSetterName(
       field.getJavaProject(),
       field.getElementName(),
       field.getFlags(),
       JavaModelUtil.isBoolean(field),
       excludedNames);
 }