View Javadoc

1   package fr.ove.utils;
2   
3   import fr.ove.utils.Formater;
4   
5   /***
6   * A formater repository.<BR>
7   * The aim of this class is to format, as a string, an object by the means of @see Formater the instance manages.<BR>
8   * To each objet (or part of object) corresponds a @see Formater.
9   * <P>
10  * The different subclasses have to implement the @see format method in the @see Formater interface the instance
11  * pretends to implement.
12  *
13  * @author © 2000 DIRAT Laurent
14  * @version 1.0 07/01/2000
15  */
16  public abstract class FormaterRepository implements Formater {
17      private String indent = "  ";
18      
19      /***
20      * Returns the current indentation
21      */
22      public String getIndent() {
23          return indent;
24      }
25      
26      /***
27      * Increments the indentation.
28      */
29      public void incIndent() {
30          indent += "  ";
31      }
32      
33      /***
34      * Decrements the indentation.
35      */
36      public void decIndent() {
37          indent = indent.substring(0, indent.length() - 2);
38      }
39      
40      /***
41      * Init indentation
42      */
43      public void initIndent() {
44          indent = "  ";
45      }
46      
47      /***
48      * Returns the formater with the specified identifier.
49      * @param objectId the object (to format) identifier.
50      */
51      public abstract Formater getFormater(String objectId);
52  }