📄 javacodeoutput.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Infozone Software License version 2 published by the Infozone Group// (http://www.infozone-group.org).//// Copyright (C) @year@ by The Infozone Group. All rights reserved.//// $Id: JavaCodeOutput.java,v 1.1 2002/05/10 08:59:12 per_nyfelt Exp $package org.infozone.tools.janalyzer;import koala.dynamicjava.tree.*;import java.io.File;import java.io.FileReader;import java.io.BufferedReader;import java.io.FileNotFoundException;import java.io.IOException;import java.io.PrintStream;import java.io.FileOutputStream;import java.util.Vector;import java.util.Collections;import org.apache.regexp.RE;import org.apache.regexp.RESyntaxException;/** * This class prints the lines of code and the affiliated comments of the output from * the JavaCodeAnalyzer class. * It makes line wrapping with splitting levels, correct indentation and comment creation. . * This all is done after the * <a href=http://xml.apache.org/source.html>Apache Source Conventions</a> * from SUN and therefore the ASF.. * * <pre> * * TODO: * - trailling comments * - more documentation * - doc comment cration for classes, constructors, fields, methods * BUGS * - comment items in "" are extracted to real comments * </pre> * * @version $Revision: 1.1 $ $Date: 2002/05/10 08:59:12 $ * @author <a href="http://www.softwarebuero.de">SMB</a> * @see org.infozone.tools.janalyzer.JavaCodeAnalyzer */public final class JavaCodeOutput extends java.lang.Object { // // constants // /** The maximum line length JCC 4.1 */ private int LINE_LENGTH; /** Constants for line wrapping nice level */ private final static int LOW_SPLIT_LEVEL = 10; private final static int MIDDLE_SPLIT_LEVEL = 25; private final static int HIGH_SPLIT_LEVEL = 50; private final static int OBLIGATION_SPLIT_LEVEL = 99; /** One indentation */ private final static String ONE_INDENT = " "; /** Indentation for automatically line wrapping */ private final static String WRAP_INDENT = " "; /** documentation comment start */ // for correct highlighting :-)=) private final static String DOC_COMMENT_START = "/" + "**"; /** block comment start */ // for correct highlighting :-)=) private final static String BLOCK_COMMENT_START = "/" + "*"; /** line comment start */ // for correct highlighting :-)=) private final static String LINE_COMMENT_START = "/" + "/"; /** block and documentation comment line start */ private final static String BLOCK_COMMENT_LINE = "*"; /** block and documentation comment end */ private final static String BLOCK_COMMENT_END = "*" + "/"; /** lines to start a created doc comment */ private final static String[] DOC_COMMENT_START_LINES = {DOC_COMMENT_START}; /** lines to end a created doc comment */ private final static String[] DOC_COMMENT_END_LINES = {BLOCK_COMMENT_END}; /** * A split character for priority expression splitting in line wrapping. * All existing split characters must be masked by double split character. * After this character follows the splitting nice level as integer. * - 1 means better no splitting * - 9 or greater means lets split * Example:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -