View Javadoc

    1   /*
    2    * joey-gen and its relative products are published under the terms
    3    * of the Apache Software License.
    4    *
    5    * Created on 2004/12/27 17:58:58
    6    */
    7   package org.asyrinx.joey.gen.model.pattern;
    8
    9   import java.util.HashMap;
    10  import java.util.Map;
    11
    12  /***
    13   * @author takeshi
    14   */
    15  public class PatternRepository {
    16
    17      /***
    18       *
    19       */
    20      protected PatternRepository() {
    21          super();
    22      }
    23
    24      private final Map patternMap = initPatternMap();
    25
    26      private static final PatternRepository instance = new PatternRepository();
    27
    28      public static PatternRepository getInstance() {
    29          return instance;
    30      }
    31
    32      private static Map initPatternMap() {
    33          final Map result = new HashMap();
    34          result.put("logical_deletable", new SingleColumnPattern("deleted", "INTEGER",
    35                  "BooleanEnum", "削除済"));
    36          result.put("created_date", new SingleColumnPattern("created_date", "TIMESTAMP", "作成日時"));
    37          result.put("updated_date", new SingleColumnPattern("updated_date", "TIMESTAMP", "更新日時"));
    38          return result;
    39      }
    40
    41      public void add(String name, Pattern pattern) {
    42          patternMap.put(name, pattern);
    43      }
    44
    45      public Pattern get(String name) {
    46          return (Pattern) patternMap.get(name);
    47      }
    48
    49  }