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.TablePattern;
    23  import org.asyrinx.joey.gen.model.rdb.TablePatternParam;
    24  import org.asyrinx.joey.gen.model.rdb.Unique;
    25
    26  /***
    27   * @author akima
    28   */
    29  public class RdbVisitorAdapter implements ElementVisitor {
    30
    31      /***
    32       *
    33       */
    34      public RdbVisitorAdapter(RdbVisitor adaptee) {
    35          super();
    36          this.adaptee = adaptee;
    37      }
    38
    39      private final RdbVisitor adaptee;
    40
    41      /*
    42       * (non-Javadoc)
    43       *
    44       * @see org.asyrinx.joey.gen.model.ElementVisitor#visit(org.asyrinx.joey.gen.model.Element)
    45       */
    46      public void visit(Element element) {
    47          if (element instanceof Column)
    48              adaptee.visit((Column) element);
    49          else if (element instanceof Database)
    50              adaptee.visit((Database) element);
    51          else if (element instanceof Databases)
    52              adaptee.visit((Databases) element);
    53          else if (element instanceof RdbEnumeration)
    54              adaptee.visit((RdbEnumeration) element);
    55          else if (element instanceof EnumerationEntry)
    56              adaptee.visit((EnumerationEntry) element);
    57          else if (element instanceof ForeignKey)
    58              adaptee.visit((ForeignKey) element);
    59          else if (element instanceof ForeignKeyEntry)
    60              adaptee.visit((ForeignKeyEntry) element);
    61          else if (element instanceof Unique)
    62              adaptee.visit((Unique) element);
    63          else if (element instanceof Index)
    64              adaptee.visit((Index) element);
    65          else if (element instanceof IndexEntry)
    66              adaptee.visit((IndexEntry) element);
    67          else if (element instanceof Table)
    68              adaptee.visit((Table) element);
    69          else if (element instanceof TablePattern)
    70              adaptee.visit((TablePattern) element);
    71          else if (element instanceof TablePatternParam)
    72              adaptee.visit((TablePatternParam) element);
    73          else
    74              this.visit(element);
    75      }
    76
    77  }