Codota Logo
JavaSource2HTMLConverter
Code IndexAdd Codota 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)

  • Common ways to obtain JavaSource2HTMLConverter
private void myMethod () {
JavaSource2HTMLConverter j =
  • Codota Iconnew JavaSource2HTMLConverter()
  • Smart code suggestions by Codota
}
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

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • getContentResolver (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JComboBox (javax.swing)
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now