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/10/26 15:58:51
    6    */
    7   package org.asyrinx.joey.gen.command.rdb;
    8
    9   import org.asyrinx.joey.gen.model.command.ValidationError;
    10  import org.asyrinx.joey.gen.model.pattern.Pattern;
    11  import org.asyrinx.joey.gen.model.pattern.PatternRepository;
    12  import org.asyrinx.joey.gen.model.rdb.TablePattern;
    13
    14  /***
    15   * @author takeshi
    16   */
    17  public class ExpandPatterns extends RdbCommand {
    18
    19      public void visit(TablePattern tablePattern) {
    20          this.log("invoked ExpandPatterns for pattern: " + tablePattern.getName());
    21
    22          final Pattern pattern = PatternRepository.getInstance().get(tablePattern.getName());
    23          if (pattern == null) {
    24              addError(tablePattern, "pattern named '" + tablePattern.getName() + "' was not found.");
    25          }
    26          try {
    27              pattern.expand(tablePattern);
    28          } catch (ValidationError e) {
    29              addError(e.getElement(), e.getMessage());
    30          }
    31      }
    32
    33  }