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 18:32:08
    6    */
    7   package org.asyrinx.joey.gen.command.rdb;
    8
    9   import org.asyrinx.joey.gen.model.Element;
    10  import org.asyrinx.joey.gen.model.EnumerationEntry;
    11  import org.asyrinx.joey.gen.model.command.Command;
    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.ForeignKey;
    16  import org.asyrinx.joey.gen.model.rdb.ForeignKeyEntry;
    17  import org.asyrinx.joey.gen.model.rdb.Index;
    18  import org.asyrinx.joey.gen.model.rdb.IndexEntry;
    19  import org.asyrinx.joey.gen.model.rdb.PrimaryKey;
    20  import org.asyrinx.joey.gen.model.rdb.RdbEnumeration;
    21  import org.asyrinx.joey.gen.model.rdb.RdbVisitor;
    22  import org.asyrinx.joey.gen.model.rdb.Table;
    23  import org.asyrinx.joey.gen.model.rdb.TablePattern;
    24  import org.asyrinx.joey.gen.model.rdb.TablePatternParam;
    25  import org.asyrinx.joey.gen.model.rdb.Unique;
    26  import org.asyrinx.joey.gen.model.rdb.visitor.RdbTopDownVisitor;
    27  import org.asyrinx.joey.gen.model.rdb.visitor.RdbVisitorAdapter;
    28
    29  /***
    30   * @author akima
    31   */
    32  public class RdbCommand extends Command implements RdbVisitor {
    33
    34      /***
    35       *
    36       */
    37      public RdbCommand() {
    38          super();
    39      }
    40
    41      public void execute(Element element) {
    42          new RdbVisitorAdapter(new RdbTopDownVisitor(this)).visit(element);
    43      }
    44
    45      /*
    46       * (non-Javadoc)
    47       *
    48       * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.Column)
    49       */
    50      public void visit(Column column) {
    51          //may be overriden by subclass
    52      }
    53
    54      /*
    55       * (non-Javadoc)
    56       *
    57       * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.Database)
    58       */
    59      public void visit(Database database) {
    60          //may be overriden by subclass
    61      }
    62
    63      /*
    64       * (non-Javadoc)
    65       *
    66       * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.Databases)
    67       */
    68      public void visit(Databases databases) {
    69          //may be overriden by subclass
    70      }
    71
    72      /*
    73       * (non-Javadoc)
    74       *
    75       * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.EnumerationEntry)
    76       */
    77      public void visit(EnumerationEntry enumerationEntry) {
    78          //may be overriden by subclass
    79      }
    80
    81      /*
    82       * (non-Javadoc)
    83       *
    84       * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.ForeignKey)
    85       */
    86      public void visit(ForeignKey foreignKey) {
    87          //may be overriden by subclass
    88      }
    89
    90      /*
    91       * (non-Javadoc)
    92       *
    93       * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.ForeignKeyEntry)
    94       */
    95      public void visit(ForeignKeyEntry foreignKeyEntry) {
    96          //may be overriden by subclass
    97      }
    98
    99      /*
    100      * (non-Javadoc)
    101      *
    102      * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.Index)
    103      */
    104     public void visit(Index index) {
    105         //may be overriden by subclass
    106     }
    107
    108     /*
    109      * (non-Javadoc)
    110      *
    111      * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.IndexEntry)
    112      */
    113     public void visit(IndexEntry indexEntry) {
    114         //may be overriden by subclass
    115     }
    116
    117     /*
    118      * (non-Javadoc)
    119      *
    120      * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.PrimaryKey)
    121      */
    122     public void visit(PrimaryKey primaryKey) {
    123         //may be overriden by subclass
    124     }
    125
    126     /*
    127      * (non-Javadoc)
    128      *
    129      * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.RdbEnumeration)
    130      */
    131     public void visit(RdbEnumeration enumeration) {
    132         //may be overriden by subclass
    133     }
    134
    135     /*
    136      * (non-Javadoc)
    137      *
    138      * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.Table)
    139      */
    140     public void visit(Table table) {
    141         //may be overriden by subclass
    142     }
    143
    144     /*
    145      * (non-Javadoc)
    146      *
    147      * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.TablePattern)
    148      */
    149     public void visit(TablePattern tablePattern) {
    150         //may be overriden by subclass
    151     }
    152
    153     /*
    154      * (non-Javadoc)
    155      *
    156      * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.TablePatternParam)
    157      */
    158     public void visit(TablePatternParam tablePatternParam) {
    159         //may be overriden by subclass
    160     }
    161
    162     /*
    163      * (non-Javadoc)
    164      *
    165      * @see org.asyrinx.joey.gen.model.rdb.RdbVisitor#visit(org.asyrinx.joey.gen.model.rdb.Unique)
    166      */
    167     public void visit(Unique unique) {
    168         //may be overriden by subclass
    169     }
    170 }