Tabnine Logo
JavaSource2HTMLConverter.convert
Code IndexAdd Tabnine to your IDE (free)

How to use
convert
method
in
de.java2html.converter.JavaSource2HTMLConverter

Best Java code snippets using de.java2html.converter.JavaSource2HTMLConverter.convert (Showing top 3 results out of 315)

origin: org.jvnet.hudson.plugins/dry

/**
 * Returns the duplicate source code fragment as formatted HTML string.
 *
 * @return the duplicate source code fragment
 */
public String getFormattedSourceCode() {
  try {
    JavaSource source = new JavaSourceParser().parse(new StringReader(sourceCode));
    JavaSource2HTMLConverter converter = new JavaSource2HTMLConverter();
    StringWriter writer = new StringWriter();
    JavaSourceConversionOptions options = JavaSourceConversionOptions.getDefault();
    options.setShowLineNumbers(false);
    options.setAddLineAnchors(false);
    converter.convert(source, options, writer);
    return writer.toString();
  }
  catch (IllegalConfigurationException exception) {
    return sourceCode;
  }
  catch (IOException exception) {
    return sourceCode;
  }
}
origin: jenkinsci/analysis-core-plugin

/**
 * Highlights the specified source and returns the result as an HTML string.
 *
 * @param file
 *            the source file to highlight
 * @return the source as an HTML string
 * @throws IOException
 *             if the source code could not be read
 */
public final String highlightSource(final InputStream file) throws IOException {
  JavaSource source = new JavaSourceParser().parse(
      new InputStreamReader(file, EncodingValidator.defaultCharset(defaultEncoding)));
  JavaSource2HTMLConverter converter = new JavaSource2HTMLConverter();
  StringWriter writer = new StringWriter();
  JavaSourceConversionOptions options = JavaSourceConversionOptions.getDefault();
  options.setShowLineNumbers(true);
  options.setAddLineAnchors(true);
  converter.convert(source, options, writer);
  return writer.toString();
}
origin: org.hudsonci.plugins/analysis-core

/**
 * Highlights the specified source and returns the result as an HTML string.
 *
 * @param file
 *            the source file to highlight
 * @return the source as an HTML string
 * @throws IOException
 *             if the source code could not be read
 */
public final String highlightSource(final InputStream file) throws IOException {
  JavaSource source = new JavaSourceParser().parse(
      new InputStreamReader(file, EncodingValidator.defaultCharset(defaultEncoding)));
  JavaSource2HTMLConverter converter = new JavaSource2HTMLConverter();
  StringWriter writer = new StringWriter();
  JavaSourceConversionOptions options = JavaSourceConversionOptions.getDefault();
  options.setShowLineNumbers(true);
  options.setAddLineAnchors(true);
  converter.convert(source, options, writer);
  return writer.toString();
}
de.java2html.converterJavaSource2HTMLConverterconvert

Popular methods of JavaSource2HTMLConverter

  • <init>

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • Menu (java.awt)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • JFrame (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now