Example usage for org.eclipse.jdt.internal.core SourceType getJavadocRange

List of usage examples for org.eclipse.jdt.internal.core SourceType getJavadocRange

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core SourceType getJavadocRange.

Prototype

@Override
    public ISourceRange getJavadocRange() throws JavaModelException 

Source Link

Usage

From source file:hydrograph.ui.expression.editor.datastructure.ClassDetails.java

License:Apache License

private String getJavaDoc(SourceType javaClassFile) throws JavaModelException {
    StringBuffer source = new StringBuffer(javaClassFile.getSource());
    try {//from  w w w  .  j  ava 2s. com
        String javaDoc = StringUtils.substring(source.toString(), 0,
                javaClassFile.getJavadocRange().getLength());
        javaDoc = StringUtils.replaceEachRepeatedly(javaDoc, new String[] { "/*", "*/", "*" },
                new String[] { Constants.EMPTY_STRING, Constants.EMPTY_STRING, Constants.EMPTY_STRING });
    } catch (Exception exception) {
        LOGGER.warn("Failed to build java-doc for :{}", javaClassFile);
    }
    return javaDoc;
}