java.lang.Object
org.aspectj.org.eclipse.jdt.internal.formatter.old.CodeFormatter
All Implemented Interfaces:
ICodeFormatter, TerminalTokens

public class CodeFormatter extends Object implements TerminalTokens, ICodeFormatter
Deprecated.

How to format a piece of code ?

  • Create an instance of CodeFormatter
  • Use the method void format(aString) on this instance to format aString. It will return the formatted string.
  • Constructor Details

    • CodeFormatter

      public CodeFormatter(Map options)
      Deprecated.
  • Method Details

    • format

      public String format(String string, int indentLevel, int[] positions, String lineSeparator)
      Deprecated.
      Description copied from interface: ICodeFormatter
      Formats the String sourceString, and returns a string containing the formatted version.
      Specified by:
      format in interface ICodeFormatter
      Parameters:
      string - the string to format
      indentLevel - the initial indentation level, used to shift left/right the entire source fragment. An initial indentation level of zero has no effect.
      positions - an array of positions to map. These are character-based source positions inside the original source, arranged in non-decreasing order, for which corresponding positions in the formatted source will be computed (so as to relocate elements associated with the original source). It updates the positions array with updated positions. If set to null, then no positions are mapped.
      lineSeparator - the line separator to use in formatted source, if set to null, then the platform default one will be used.
      Returns:
      the formatted output string.