Adopt Renderables in Javadoc. Refactoring for building mvn projects
This commit is contained in:
@@ -2,6 +2,7 @@ package org.springframework.ide.vscode.commons.java.roaster;
|
||||
|
||||
import org.jboss.forge.roaster.model.JavaDoc;
|
||||
import org.springframework.ide.vscode.commons.javadoc.IJavadoc;
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
|
||||
public class RoasterJavadoc implements IJavadoc {
|
||||
|
||||
@@ -13,22 +14,13 @@ public class RoasterJavadoc implements IJavadoc {
|
||||
|
||||
@Override
|
||||
public String raw() {
|
||||
throw new UnsupportedOperationException("Not yet implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String plainText() {
|
||||
return javadoc.getFullText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String html() {
|
||||
public Renderable getRenderable() {
|
||||
throw new UnsupportedOperationException("Not yet implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String markdown() {
|
||||
throw new UnsupportedOperationException("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package org.springframework.ide.vscode.commons.javadoc;
|
||||
|
||||
import com.overzealous.remark.Remark;
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
import org.springframework.ide.vscode.commons.util.Renderables;
|
||||
|
||||
public class HtmlJavadoc implements IJavadoc {
|
||||
|
||||
private String html;
|
||||
private Remark remark;
|
||||
|
||||
public HtmlJavadoc(String html) {
|
||||
this.html = html;
|
||||
this.remark = new Remark();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -18,18 +17,9 @@ public class HtmlJavadoc implements IJavadoc {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String plainText() {
|
||||
throw new UnsupportedOperationException("Not yet implemnted");
|
||||
public Renderable getRenderable() {
|
||||
return Renderables.htmlBlob(html);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String html() {
|
||||
return html;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String markdown() {
|
||||
return remark.convertFragment(html);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package org.springframework.ide.vscode.commons.javadoc;
|
||||
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
|
||||
public interface IJavadoc {
|
||||
|
||||
String raw();
|
||||
|
||||
String plainText();
|
||||
Renderable getRenderable();
|
||||
|
||||
String html();
|
||||
|
||||
String markdown();
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.springframework.ide.vscode.commons.javadoc;
|
||||
|
||||
import org.springframework.ide.vscode.commons.util.Renderable;
|
||||
|
||||
public class RawJavadoc implements IJavadoc {
|
||||
|
||||
private String rawContent;
|
||||
@@ -14,18 +16,8 @@ public class RawJavadoc implements IJavadoc {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String plainText() {
|
||||
throw new UnsupportedOperationException("Not yet implemnted");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String html() {
|
||||
throw new UnsupportedOperationException("Not yet implemnted");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String markdown() {
|
||||
throw new UnsupportedOperationException("Not yet implemnted");
|
||||
public Renderable getRenderable() {
|
||||
throw new UnsupportedOperationException("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user