public String getReturnTypeSignature() { try { return m_method.getReturnType(); } catch(JavaModelException jme) { ; } return ""; }
private boolean needsReturnTag() { if (fMethod == null) { return false; } try { return !Signature.SIG_VOID.equals(fMethod.getReturnType()); } catch (JavaModelException e) { return false; } }
public static boolean isRenameProhibited(final IMethod method) throws CoreException { if (method.getElementName().equals("toString") //$NON-NLS-1$ && (method.getNumberOfParameters() == 0) && (method.getReturnType().equals("Ljava.lang.String;") //$NON-NLS-1$ || method.getReturnType().equals("QString;") //$NON-NLS-1$ || method.getReturnType().equals("Qjava.lang.String;"))) { return true; } else { return false; } }
public static boolean isRenameProhibited(final IMethod method) throws CoreException { if (method.getElementName().equals("toString") //$NON-NLS-1$ && (method.getNumberOfParameters() == 0) && (method.getReturnType().equals("Ljava.lang.String;") //$NON-NLS-1$ || method.getReturnType().equals("QString;") //$NON-NLS-1$ || method.getReturnType().equals("Qjava.lang.String;"))) //$NON-NLS-1$ return true; else return false; }
public static boolean isRenameProhibited(final IMethod method) throws CoreException { if (method.getElementName().equals("toString") //$NON-NLS-1$ && (method.getNumberOfParameters() == 0) && (method.getReturnType().equals("Ljava.lang.String;") //$NON-NLS-1$ || method.getReturnType().equals("QString;") //$NON-NLS-1$ || method.getReturnType().equals("Qjava.lang.String;"))) //$NON-NLS-1$ return true; else return false; }
public static boolean isRenameProhibited(final IMethod method) throws CoreException { if (method.getElementName().equals("toString") //$NON-NLS-1$ && (method.getNumberOfParameters() == 0) && (method.getReturnType().equals("Ljava.lang.String;") //$NON-NLS-1$ || method.getReturnType().equals("QString;") //$NON-NLS-1$ || method.getReturnType().equals("Qjava.lang.String;"))) //$NON-NLS-1$ return true; else return false; }
private boolean needsReturnTag() { if (fMethod == null) return false; try { return ! Signature.SIG_VOID.equals(fMethod.getReturnType()); } catch (JavaModelException e) { JavaPlugin.log(e); return false; } }
private boolean isMethodToSuggest(IMethod method) { try { String methodName= method.getElementName(); return method.getNumberOfParameters() == 0 && !Signature.SIG_VOID.equals(method.getReturnType()) && (methodName.startsWith("get") || methodName.startsWith("is")); //$NON-NLS-1$//$NON-NLS-2$ } catch (JavaModelException e) { return false; } }
private boolean isMethodToSuggest(IMethod method) { try { String methodName= method.getElementName(); return method.getNumberOfParameters() == 0 && !Signature.SIG_VOID.equals(method.getReturnType()) && (methodName.startsWith("get") || methodName.startsWith("is")); //$NON-NLS-1$//$NON-NLS-2$ } catch (JavaModelException e) { return false; } }
private boolean isMethodToSuggest(IMethod method) { try { String methodName= method.getElementName(); return method.getNumberOfParameters() == 0 && !Signature.SIG_VOID.equals(method.getReturnType()) && (methodName.startsWith("get") || methodName.startsWith("is")); //$NON-NLS-1$//$NON-NLS-2$ } catch (JavaModelException e) { return false; } }
protected String resolve(TemplateContext context) { IJavaElement element= ((CompilationUnitContext) context).findEnclosingElement(IJavaElement.METHOD); if (element == null) return null; try { return Signature.toString(((IMethod) element).getReturnType()); } catch (JavaModelException e) { return null; } } }
@Override protected String resolve(TemplateContext context) { IJavaElement element= ((CompilationUnitContext) context).findEnclosingElement(IJavaElement.METHOD); if (element == null) return null; try { return Signature.toString(((IMethod) element).getReturnType()); } catch (JavaModelException e) { return null; } } }
@Override protected String resolve(TemplateContext context) { IJavaElement element= ((CompilationUnitContext) context).findEnclosingElement(IJavaElement.METHOD); if (element == null) return null; try { return Signature.toString(((IMethod) element).getReturnType()); } catch (JavaModelException e) { return null; } } }
private static boolean isValueAccessor(IMethod method) throws JavaModelException { if (!"getString".equals(method.getElementName())) //$NON-NLS-1$ return false; int flags= method.getFlags(); if (!Modifier.isStatic(flags) || !Modifier.isPublic(flags)) return false; String returnType= method.getReturnType(); if (!JAVA_LANG_STRING.equals(returnType)) return false; String[] parameters= method.getParameterTypes(); if (parameters.length != 1 || !JAVA_LANG_STRING.equals(parameters[0])) return false; return true; }
@Override public boolean isMethodOK(IMethod method) throws JavaModelException { return Flags.isPublic(method.getFlags()) && method.getParameterTypes().length == 0 && "java.lang.String".equals(JavaModelUtil.getResolvedTypeName(method.getReturnType(), type)); //$NON-NLS-1$ } });
@Override public boolean isMethodOK(IMethod method) throws JavaModelException { return Flags.isPublic(method.getFlags()) && method.getParameterTypes().length == 0 && "java.lang.String".equals(JavaModelUtil.getResolvedTypeName(method.getReturnType(), type)); //$NON-NLS-1$ } });
@Override protected void addHyperlinks(List<IHyperlink> hyperlinksCollector, IRegion wordRegion, SelectionDispatchAction openAction, IJavaElement element, boolean qualify, JavaEditor editor) { try { if (element.getElementType() == IJavaElement.METHOD && !JavaModelUtil.isPrimitive(((IMethod)element).getReturnType()) && SelectionConverter.canOperateOn(editor)) { hyperlinksCollector.add(new JavaElementReturnTypeHyperlink(wordRegion, openAction, (IMethod)element, qualify)); } } catch (JavaModelException e) { JavaPlugin.log(e); } } }
@Override protected void addHyperlinks(List<IHyperlink> hyperlinksCollector, IRegion wordRegion, SelectionDispatchAction openAction, IJavaElement element, boolean qualify, JavaEditor editor) { try { if (element.getElementType() == IJavaElement.METHOD && !JavaModelUtil.isPrimitive(((IMethod)element).getReturnType()) && SelectionConverter.canOperateOn(editor)) { hyperlinksCollector.add(new JavaElementReturnTypeHyperlink(wordRegion, openAction, (IMethod)element, qualify)); } } catch (JavaModelException e) { JavaPlugin.log(e); } } }
public static boolean hasSuiteMethod(IType type) throws JavaModelException { IMethod method= type.getMethod("suite", new String[0]); //$NON-NLS-1$ if (!method.exists()) return false; if (!Flags.isStatic(method.getFlags()) || !Flags.isPublic(method.getFlags())) { return false; } if (!Signature.getSimpleName(Signature.toString(method.getReturnType())).equals(JUnitCorePlugin.SIMPLE_TEST_INTERFACE_NAME)) { return false; } return true; }
public static boolean hasSuiteMethod(IType type) throws JavaModelException { IMethod method= type.getMethod("suite", new String[0]); //$NON-NLS-1$ if (!method.exists()) return false; if (!Flags.isStatic(method.getFlags()) || !Flags.isPublic(method.getFlags())) { return false; } if (!Signature.getSimpleName(Signature.toString(method.getReturnType())).equals(JUnitCorePlugin.SIMPLE_TEST_INTERFACE_NAME)) { return false; } return true; }