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:41:40
    6    */
    7   package org.asyrinx.joey.gen.model.java.visitor;
    8
    9   import java.util.Iterator;
    10
    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 JavaTopDownVisitor extends JavaVisitorWrapper {
    23
    24      /***
    25       * @param wrapped
    26       */
    27      public JavaTopDownVisitor(JavaVisitor wrapped) {
    28          super(wrapped);
    29      }
    30
    31      /*
    32       * (non-Javadoc)
    33       *
    34       * @see org.asyrinx.joey.gen.model.java.JavaVisitor#visit(org.asyrinx.joey.gen.model.java.AppDomain)
    35       */
    36      public void visit(AppDomain appDomain) {
    37          super.visit(appDomain);
    38          for (Iterator i = appDomain.getEnumerations().iterator(); i.hasNext();) {
    39              final JavaEnumeration element = (JavaEnumeration) i.next();
    40              visit(element);
    41          }
    42          for (Iterator i = appDomain.getClasses().iterator(); i.hasNext();) {
    43              final Entity element = (Entity) i.next();
    44              visit(element);
    45          }
    46      }
    47
    48      /*
    49       * (non-Javadoc)
    50       *
    51       * @see org.asyrinx.joey.gen.model.java.JavaVisitor#visit(org.asyrinx.joey.gen.model.java.Entity)
    52       */
    53      public void visit(Entity javaClass) {
    54          super.visit(javaClass);
    55          for (Iterator i = javaClass.getProperties().iterator(); i.hasNext();) {
    56              final Property element = (Property) i.next();
    57              visit(element);
    58          }
    59          for (Iterator i = javaClass.getKeys().iterator(); i.hasNext();) {
    60              final EntityKey element = (EntityKey) i.next();
    61              visit(element);
    62          }
    63          for (Iterator i = javaClass.getReferences().iterator(); i.hasNext();) {
    64              final Reference element = (Reference) i.next();
    65              visit(element);
    66          }
    67      }
    68
    69      /*
    70       * (non-Javadoc)
    71       *
    72       * @see org.asyrinx.joey.gen.model.java.JavaVisitor#visit(org.asyrinx.joey.gen.model.java.EntityKey)
    73       */
    74      public void visit(EntityKey javaClassKey) {
    75          super.visit(javaClassKey);
    76      }
    77
    78      /*
    79       * (non-Javadoc)
    80       *
    81       * @see org.asyrinx.joey.gen.model.java.JavaVisitor#visit(org.asyrinx.joey.gen.model.java.JavaEnumeration)
    82       */
    83      public void visit(JavaEnumeration enum) {
    84          super.visit(enum);
    85      }
    86
    87      /*
    88       * (non-Javadoc)
    89       *
    90       * @see org.asyrinx.joey.gen.model.java.JavaVisitor#visit(org.asyrinx.joey.gen.model.java.Property)
    91       */
    92      public void visit(Property property) {
    93          super.visit(property);
    94      }
    95
    96      /*
    97       * (non-Javadoc)
    98       *
    99       * @see org.asyrinx.joey.gen.model.java.JavaVisitor#visit(org.asyrinx.joey.gen.model.java.Reference)
    100      */
    101     public void visit(Reference reference) {
    102         super.visit(reference);
    103     }
    104 }