emolib.util
Class IndentationFormatter

java.lang.Object
  extended by emolib.util.IndentationFormatter

public class IndentationFormatter
extends java.lang.Object

The IndentationFormatter class performs a check-and-correct process of the indentation of the source files compiled in the input file.

The motivation behind this class is the standardisation of the code style. It checks (and corrects if a mistake is found) that the indentations follow a reasonable structure, i.e., after x spaces, x + 4 follow, if a curly brace ends the previous line, and so on.

After the process, each modified file will have a "file.indent" version to compare the effect of the indentation sets.

Author:
Alexandre Trilla (atrilla@salle.url.edu)

Constructor Summary
IndentationFormatter()
          Void constructor.
 
Method Summary
 java.lang.String correctIndentation(java.lang.String line)
          Function to correct the indentation of a line of code.
static void main(java.lang.String[] args)
           
 void printSynopsis()
          Prints the synopsis.
 void resetIndent()
          Method to reset the indetation level counter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndentationFormatter

public IndentationFormatter()
Void constructor.

Method Detail

resetIndent

public void resetIndent()
Method to reset the indetation level counter.


printSynopsis

public void printSynopsis()
Prints the synopsis.


correctIndentation

public java.lang.String correctIndentation(java.lang.String line)
Function to correct the indentation of a line of code.

Parameters:
line - The line of code.
Returns:
The line with correct indents.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception