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/08/15 15:14:06
    6    */
    7   package org.asyrinx.joey.gen.model.rdb.visitor;
    8
    9   import org.asyrinx.joey.gen.model.Element;
    10  import org.asyrinx.joey.gen.model.EnumerationEntry;
    11  import org.asyrinx.joey.gen.model.ElementVisitor;
    12  import org.asyrinx.joey.gen.model.rdb.Column;
    13  import org.asyrinx.joey.gen.model.rdb.Database;
    14  import org.asyrinx.joey.gen.model.rdb.Databases;
    15  import org.asyrinx.joey.gen.model.rdb.RdbEnumeration;
    16  import org.asyrinx.joey.gen.model.rdb.ForeignKey;
    17  import org.asyrinx.joey.gen.model.rdb.ForeignKeyEntry;
    18  import org.asyrinx.joey.gen.model.rdb.Index;
    19  import org.asyrinx.joey.gen.model.rdb.IndexEntry;
    20  import org.asyrinx.joey.gen.model.rdb.RdbVisitor;
    21  import org.asyrinx.joey.gen.model.rdb.Table;
    22  import org.asyrinx.joey.gen.model.rdb.Unique;
    23
    24  /***
    25   * @author akima
    26   */
    27  public class RdbVisitorAdapter implements ElementVisitor {
    28
    29      /***
    30       *
    31       */
    32      public RdbVisitorAdapter(RdbVisitor adaptee) {
    33          super();
    34          this.adaptee = adaptee;
    35      }
    36
    37      private final RdbVisitor adaptee;
    38
    39      /*
    40       * (non-Javadoc)
    41       *
    42       * @see org.asyrinx.joey.gen.model.ElementVisitor#visit(org.asyrinx.joey.gen.model.Element)
    43       */
    44      public void visit(Element element) {
    45          if (element instanceof Column)
    46              adaptee.visit((Column) element);
    47          else if (element instanceof Database)
    48              adaptee.visit((Database) element);
    49          else if (element instanceof Databases)
    50              adaptee.visit((Databases) element);
    51          else if (element instanceof RdbEnumeration)
    52              adaptee.visit((RdbEnumeration) element);
    53          else if (element instanceof EnumerationEntry)
    54              adaptee.visit((EnumerationEntry) element);
    55          else if (element instanceof ForeignKey)
    56              adaptee.visit((ForeignKey) element);
    57          else if (element instanceof ForeignKeyEntry)
    58              adaptee.visit((ForeignKeyEntry) element);
    59          else if (element instanceof Unique)
    60              adaptee.visit((Unique) element);
    61          else if (element instanceof Index)
    62              adaptee.visit((Index) element);
    63          else if (element instanceof IndexEntry)
    64              adaptee.visit((IndexEntry) element);
    65          else if (element instanceof Table)
    66              adaptee.visit((Table) element);
    67          else
    68              this.visit(element);
    69      }
    70
    71  }