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/11/09 12:36:03
    6    */
    7   package org.asyrinx.joey.gen.model.java.visitor;
    8
    9   import org.asyrinx.joey.gen.model.Element;
    10  import org.asyrinx.joey.gen.model.ElementVisitor;
    11  import org.asyrinx.joey.gen.model.java.AppDomain;
    12  import org.asyrinx.joey.gen.model.java.Entity;
    13  import org.asyrinx.joey.gen.model.java.EntityKey;
    14  import org.asyrinx.joey.gen.model.java.JavaEnumeration;
    15  import org.asyrinx.joey.gen.model.java.JavaVisitor;
    16  import org.asyrinx.joey.gen.model.java.Property;
    17  import org.asyrinx.joey.gen.model.java.Reference;
    18
    19  /***
    20   * @author takeshi
    21   */
    22  public class JavaVisitorAdapter implements ElementVisitor {
    23
    24      /***
    25       *
    26       */
    27      public JavaVisitorAdapter(JavaVisitor adaptee) {
    28          super();
    29          this.adaptee = adaptee;
    30      }
    31
    32      protected final JavaVisitor adaptee;
    33
    34      /*
    35       * (non-Javadoc)
    36       *
    37       * @see org.asyrinx.joey.gen.model.ElementVisitor#visit(org.asyrinx.joey.gen.model.Element)
    38       */
    39      public void visit(Element element) {
    40          if (element instanceof AppDomain)
    41              adaptee.visit((AppDomain) element);
    42          else if (element instanceof Entity)
    43              adaptee.visit((Entity) element);
    44          else if (element instanceof EntityKey)
    45              adaptee.visit((EntityKey) element);
    46          else if (element instanceof JavaEnumeration)
    47              adaptee.visit((JavaEnumeration) element);
    48          else if (element instanceof Property)
    49              adaptee.visit((Property) element);
    50          else if (element instanceof Reference)
    51              adaptee.visit((Reference) element);
    52          else
    53              this.visit(element);
    54      }
    55  }