private boolean inheritExceptionDescriptions(List<String> exceptionNames, CharSequence[] exceptionDescriptions) { boolean hasInheritedExceptions= false; for (int i= 0; i < exceptionNames.size(); i++) { String name= exceptionNames.get(i); if (name != null) { exceptionDescriptions[i]= fJavadocLookup.getInheritedExceptionDescription(fMethod, name); if (exceptionDescriptions[i] != null) hasInheritedExceptions= true; } } return hasInheritedExceptions; }
handleContentElements(start.fragments()); else if (fMethod != null) { CharSequence inherited= fJavadocLookup.getInheritedMainDescription(fMethod); returnDescription= fJavadocLookup.getInheritedReturnDescription(fMethod); boolean hasReturnTag= returnTag != null || returnDescription != null;
int i= parameterNames.indexOf(elementName); if (i != -1) { CharSequence inheritedParamDescription= fJavadocLookup.getInheritedParamDescription(fMethod, i); handleInherited(inheritedParamDescription); int i= typeParameterNames.indexOf(elementName); if (i != -1) { CharSequence inheritedTypeParamDescription= fJavadocLookup.getInheritedTypeParamDescription(fMethod, i); handleInherited(inheritedTypeParamDescription);
handleContentElements(start.fragments()); else if (fMethod != null) { CharSequence inherited= fJavadocLookup.getInheritedMainDescription(fMethod); returnDescription= fJavadocLookup.getInheritedReturnDescription(fMethod); boolean hasReturnTag= returnTag != null || returnDescription != null;
CharSequence inherited= fJavadocLookup.getInheritedMainDescription(fMethod); return handleInherited(inherited); for (int i= 0; i < parameterNames.length; i++) { if (name.equals(parameterNames[i])) { CharSequence inherited= fJavadocLookup.getInheritedParamDescription(fMethod, i); return handleInherited(inherited); ITypeParameter typeParameter= typeParameters[i]; if (name.equals(typeParameter.getElementName())) { CharSequence inherited= fJavadocLookup.getInheritedTypeParamDescription(fMethod, i); return handleInherited(inherited); CharSequence inherited= fJavadocLookup.getInheritedReturnDescription(fMethod); return handleInherited(inherited); if (first instanceof Name) { String name= ASTNodes.getSimpleNameIdentifier((Name) first); CharSequence inherited= fJavadocLookup.getInheritedExceptionDescription(fMethod, name); return handleInherited(inherited);
CharSequence inherited= fJavadocLookup.getInheritedMainDescription(fMethod); return handleInherited(inherited); for (int i= 0; i < parameterNames.length; i++) { if (name.equals(parameterNames[i])) { CharSequence inherited= fJavadocLookup.getInheritedParamDescription(fMethod, i); return handleInherited(inherited); ITypeParameter typeParameter= typeParameters[i]; if (name.equals(typeParameter.getElementName())) { CharSequence inherited= fJavadocLookup.getInheritedTypeParamDescription(fMethod, i); return handleInherited(inherited); CharSequence inherited= fJavadocLookup.getInheritedReturnDescription(fMethod); return handleInherited(inherited); if (first instanceof Name) { String name= ASTNodes.getSimpleNameIdentifier((Name) first); CharSequence inherited= fJavadocLookup.getInheritedExceptionDescription(fMethod, name); return handleInherited(inherited);
int i= parameterNames.indexOf(elementName); if (i != -1) { CharSequence inheritedParamDescription= fJavadocLookup.getInheritedParamDescription(fMethod, i); handleInherited(inheritedParamDescription); int i= typeParameterNames.indexOf(elementName); if (i != -1) { CharSequence inheritedTypeParamDescription= fJavadocLookup.getInheritedTypeParamDescription(fMethod, i); handleInherited(inheritedTypeParamDescription);
return InheritDocVisitor.CONTINUE; }.visitInheritDoc(method.getDeclaringType(), getTypeHierarchy()); } catch (JavaModelException e) { JavaPlugin.log(e);
return InheritDocVisitor.CONTINUE; }.visitInheritDoc(method.getDeclaringType(), getTypeHierarchy()); } catch (JavaModelException e) { JavaPlugin.log(e);
private static String javadoc2HTML(IMember member, IJavaElement element, String rawJavadoc) { Javadoc javadoc= getJavadocNode(member, rawJavadoc); if (javadoc == null) { Reader contentReader= null; // fall back to JavadocContentAccess: try { contentReader= JavadocContentAccess.getHTMLContentReader(member, false, false); if (contentReader != null) return getString(contentReader); } catch (JavaModelException e) { JavaPlugin.log(e); } finally { if (contentReader != null) { try { contentReader.close(); } catch (IOException e) { //ignore } } } return null; } if (canInheritJavadoc(member)) { IMethod method= (IMethod) member; return new JavadocContentAccess2(element, javadoc, rawJavadoc, new JavadocLookup(method.getDeclaringType())).toHTML(); } return new JavadocContentAccess2(element, javadoc, rawJavadoc).toHTML(); }
private static String javadoc2HTML(IMember member, IJavaElement element, String rawJavadoc) { Javadoc javadoc= getJavadocNode(member, rawJavadoc); if (javadoc == null) { Reader contentReader= null; // fall back to JavadocContentAccess: try { contentReader= JavadocContentAccess.getHTMLContentReader(member, false, false); if (contentReader != null) return getString(contentReader); } catch (JavaModelException e) { JavaPlugin.log(e); } finally { if (contentReader != null) { try { contentReader.close(); } catch (IOException e) { //ignore } } } return null; } if (canInheritJavadoc(member)) { IMethod method= (IMethod) member; return new JavadocContentAccess2(element, javadoc, rawJavadoc, new JavadocLookup(method.getDeclaringType())).toHTML(); } return new JavadocContentAccess2(element, javadoc, rawJavadoc).toHTML(); }
/** * For the given method, returns the @param tag description for the given type parameter * from an overridden method. * * @param method a method * @param typeParamIndex the index of the type parameter * @return the description that replaces the <code>{@inheritDoc}</code> tag, or * <code>null</code> if none could be found */ public CharSequence getInheritedTypeParamDescription(IMethod method, final int typeParamIndex) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) throws JavaModelException { return contentAccess.getInheritedTypeParamDescription(typeParamIndex); } }); }
/** * For the given method, returns the @throws/@exception tag description for the given * exception from an overridden method. * * @param method a method * @param simpleName the simple name of an exception * @return the description that replaces the <code>{@inheritDoc}</code> tag, * or <code>null</code> if none could be found */ public CharSequence getInheritedExceptionDescription(IMethod method, final String simpleName) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) { return contentAccess.getExceptionDescription(simpleName); } }); }
/** * For the given method, returns the @param tag description for the given parameter from an * overridden method. * * @param method a method * @param paramIndex the index of the parameter * @return the description that replaces the <code>{@inheritDoc}</code> tag, * or <code>null</code> if none could be found */ public CharSequence getInheritedParamDescription(IMethod method, final int paramIndex) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) throws JavaModelException { return contentAccess.getInheritedParamDescription(paramIndex); } }); }
/** * For the given method, returns the @param tag description for the given type parameter * from an overridden method. * * @param method a method * @param typeParamIndex the index of the type parameter * @return the description that replaces the <code>{@inheritDoc}</code> tag, or * <code>null</code> if none could be found */ public CharSequence getInheritedTypeParamDescription(IMethod method, final int typeParamIndex) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) throws JavaModelException { return contentAccess.getInheritedTypeParamDescription(typeParamIndex); } }); }
/** * For the given method, returns the @param tag description for the given parameter from an * overridden method. * * @param method a method * @param paramIndex the index of the parameter * @return the description that replaces the <code>{@inheritDoc}</code> tag, * or <code>null</code> if none could be found */ public CharSequence getInheritedParamDescription(IMethod method, final int paramIndex) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) throws JavaModelException { return contentAccess.getInheritedParamDescription(paramIndex); } }); }
/** * For the given method, returns the @throws/@exception tag description for the given * exception from an overridden method. * * @param method a method * @param simpleName the simple name of an exception * @return the description that replaces the <code>{@inheritDoc}</code> tag, * or <code>null</code> if none could be found */ public CharSequence getInheritedExceptionDescription(IMethod method, final String simpleName) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) { return contentAccess.getExceptionDescription(simpleName); } }); }
/** * For the given method, returns the main description from an overridden method. * * @param method a method * @return the description that replaces the <code>{@inheritDoc}</code> tag, * or <code>null</code> if none could be found */ public CharSequence getInheritedMainDescription(IMethod method) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) { return contentAccess.getMainDescription(); } }); }
/** * For the given method, returns the main description from an overridden method. * * @param method a method * @return the description that replaces the <code>{@inheritDoc}</code> tag, * or <code>null</code> if none could be found */ public CharSequence getInheritedMainDescription(IMethod method) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) { return contentAccess.getMainDescription(); } }); }
/** * For the given method, returns the @return tag description from an overridden method. * * @param method a method * @return the description that replaces the <code>{@inheritDoc}</code> tag, * or <code>null</code> if none could be found */ public CharSequence getInheritedReturnDescription(IMethod method) { return getInheritedDescription(method, new DescriptionGetter() { @Override public CharSequence getDescription(JavadocContentAccess2 contentAccess) { return contentAccess.getReturnDescription(); } }); }