private boolean isNLSField(IField field) throws JavaModelException { int flags= field.getFlags(); if (!Flags.isPublic(flags)) return false; if (!Flags.isStatic(flags)) return false; String fieldName= field.getElementName(); if (NLSRefactoring.BUNDLE_NAME.equals(fieldName)) return false; if ("RESOURCE_BUNDLE".equals(fieldName)) //$NON-NLS-1$ return false; return true; }
private FieldDeclaration convert(IField field, IType type) throws JavaModelException { TypeReference typeReference = createTypeReference(field.getTypeSignature()); if (typeReference == null) return null; FieldDeclaration fieldDeclaration = new FieldDeclaration(); fieldDeclaration.name = field.getElementName().toCharArray(); fieldDeclaration.type = typeReference; fieldDeclaration.modifiers = field.getFlags(); return fieldDeclaration; }
private FieldDeclaration convert(IField field, IType type) throws JavaModelException { TypeReference typeReference = createTypeReference(field.getTypeSignature()); if (typeReference == null) return null; FieldDeclaration fieldDeclaration = new FieldDeclaration(); fieldDeclaration.name = field.getElementName().toCharArray(); fieldDeclaration.type = typeReference; fieldDeclaration.modifiers = field.getFlags(); return fieldDeclaration; }
private FieldDeclaration convert(IField field, IType type) throws JavaModelException { TypeReference typeReference = createTypeReference(field.getTypeSignature()); if (typeReference == null) return null; FieldDeclaration fieldDeclaration = new FieldDeclaration(); fieldDeclaration.name = field.getElementName().toCharArray(); fieldDeclaration.type = typeReference; fieldDeclaration.modifiers = field.getFlags(); return fieldDeclaration; }
private FieldDeclaration convert(IField field, IType type) throws JavaModelException { TypeReference typeReference = createTypeReference(field.getTypeSignature()); if (typeReference == null) return null; FieldDeclaration fieldDeclaration = new FieldDeclaration(); fieldDeclaration.name = field.getElementName().toCharArray(); fieldDeclaration.type = typeReference; fieldDeclaration.modifiers = field.getFlags(); return fieldDeclaration; }
private FieldDeclaration convert(IField field, IType type) throws JavaModelException { TypeReference typeReference = createTypeReference(field.getTypeSignature()); if (typeReference == null) return null; FieldDeclaration fieldDeclaration = new FieldDeclaration(); fieldDeclaration.name = field.getElementName().toCharArray(); fieldDeclaration.type = typeReference; fieldDeclaration.modifiers = field.getFlags(); return fieldDeclaration; }
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); }
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 String getSetterName(IField field, String[] excludedNames) throws JavaModelException { if (excludedNames == null) { excludedNames= EMPTY; } return NamingConventions.suggestSetterName(field.getJavaProject(), field.getElementName(), field.getFlags(), JavaModelUtil.isBoolean(field), excludedNames); }
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); }
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 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); }
private static boolean isBinaryPrimitiveConstantOrString(IJavaElement element) { if (element != null && element.getElementType() == IJavaElement.FIELD) { IField field= (IField)element; int flags; try { flags= field.getFlags(); } catch (JavaModelException ex) { return false; } return field.isBinary() && Flags.isStatic(flags) && Flags.isFinal(flags) && isPrimitiveOrString(field); } return false; }
private void initialize(IField field) throws JavaModelException { fGetterName= GetterSetterUtil.getGetterName(field, null); fSetterName= GetterSetterUtil.getSetterName(field, null); fArgName= NamingConventions.removePrefixAndSuffixForFieldName(field.getJavaProject(), field.getElementName(), field.getFlags()); checkArgName(); }
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); }
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); }
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); }