@Override
public String getObject() {
try {
String resourceName = CodeReaderPanel.this.sourceInfo.getResourceName();
Class<?> context = CodeReaderPanel.this.sourceInfo.getContext();
FORMAT format = CodeReaderPanel.this.sourceInfo.getFormat();
JavaSourceConversionSettings settings = JavaSourceConversionSettings.getDefault();
settings.getConversionOptions().setShowLineNumbers(true);
if(format.equals(FORMAT.JAVA) || format.equals(FORMAT.HTML)|| format.equals(FORMAT.XML)) {
InputStream in = context.getResourceAsStream(resourceName);
if(in != null)
return Java2Html.convertToHtml(new String(FileUtils.bytes(in)),settings);
return new StringBuffer().append("File ").append(resourceName).append(" not found!").toString();
}