private static String getAnnotations(IJavaElement element, ITypeRoot editorInputElement, IRegion hoverRegion) throws URISyntaxException, JavaModelException { if (!(element instanceof IPackageFragment)) { if (!(element instanceof IAnnotatable)) return null; if (((IAnnotatable)element).getAnnotations().length == 0) return null; } IBinding binding= getHoveredNodeBinding(element, editorInputElement, hoverRegion); if (binding == null) return null; IAnnotationBinding[] annotations= binding.getAnnotations(); if (annotations.length == 0) return null; StringBuffer buf= new StringBuffer(); for (int i= 0; i < annotations.length; i++) { //TODO: skip annotations that don't have an @Documented annotation? addAnnotation(buf, annotations[i], true); buf.append("<br>"); //$NON-NLS-1$ } return buf.toString(); }
IBinding binding= getHoveredNodeBinding(method, editorInputElement, hoverRegion); if (binding instanceof IMethodBinding) { Object value= ((IMethodBinding) binding).getDefaultValue();