Package de.java2html.options

Examples of de.java2html.options.JavaSourceConversionOptions


      //Create a converter and write the JavaSource object as Html
      JavaSource2HTMLConverter converter = new JavaSource2HTMLConverter();
      StringWriter writer = new StringWriter();
      writer.append(HTML_START);
      try {
         JavaSourceConversionOptions options = JavaSourceConversionOptions.getDefault();
         options.setShowLineNumbers(true);
        converter.convert(jsource, options, writer);
      } catch (IOException e) {
        //
      }
      StringMediaResource mr = new StringMediaResource();
View Full Code Here


    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) {
View Full Code Here

   
    List<Integer> highlights = new CodeHighlightTag().getHighlights(options);
   
    string = indentator.indent(string);
 
    JavaSourceConversionOptions conversionOptions = JavaSourceConversionOptions.getDefault();
    conversionOptions.setShowLineNumbers(numbered);
   
    JavaSourceConversionSettings settings = new JavaSourceConversionSettings(conversionOptions) {
      @Override
      public IJavaSourceConverter createConverter() {
        return new JavaSource2Xhtml11Converter();
View Full Code Here

    boolean numbered = isNumbered(opts);
    List<Integer> highlights = new CodeHighlightTag().getHighlights(opts);
   
    string = indentator.indent(string);
   
    JavaSourceConversionOptions options = JavaSourceConversionOptions.getDefault();
      options.setShowLineNumbers(numbered);
     
    JavaSourceConversionSettings settings = new JavaSourceConversionSettings(options) {
      @Override
      public IJavaSourceConverter createConverter() {
        return new JavaSource2TeXConverter();
View Full Code Here

        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();
    }
View Full Code Here

TOP

Related Classes of de.java2html.options.JavaSourceConversionOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.