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

How to use
JavaSource2HTMLConverter
in
de.java2html.converter

Best Java code snippets using de.java2html.converter.JavaSource2HTMLConverter (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.converterJavaSource2HTMLConverter

Most used methods

  • <init>
  • convert

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Best IntelliJ plugins
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