Class ReflectiveVisitor

java.lang.Object
eu.bandm.tools.umod.UMod.Visitor
eu.bandm.tools.umod.ReflectiveVisitor

public class ReflectiveVisitor extends UMod.Visitor
Realizes a visitor which is driven by the concrete contents of a certain instance of a umod model.
The currently visited object is stored in model, the XXX
  • Field Details

  • Constructor Details

    • ReflectiveVisitor

      public ReflectiveVisitor(UMod.Forest f)
  • Method Details

    • matchModel

      public void matchModel(UMod.ClassDef cd, Object o)
    • getFieldValue

      public static Object getFieldValue(Object o, UMod.FieldDef fd)
      Reads the content of a given field by applying java.lang.reflect methods.
    • getSpecialization

      public UMod.ClassDef getSpecialization(Object o)
      Finds the most specialized UMOd class definition for a certain object. Uses the naming!
    • modelAction

      public void modelAction(Object o)
      Action for each model object, may be over-ridden by user of this Visitor. Is possibly called MORE THAN once for each object, before descending to the fields. May read "curfd", "curcd", "referingObject" as the objects and umod definitions which LEAD TO visiting this model object.
    • action

      public void action(UMod.ClassDef cd)
      Is possibly called MORE THAN once for each object. Calls "modelAction()" and then descends to the fields.
      reads global field "model" and writes "referingObject".
      Overrides:
      action in class UMod.Visitor
    • visitFields

      protected void visitFields(UMod.ClassDef cd)
      Descend to fields of the current model "model"; this is done ONLY ONCE for each model.
      Fields of superclass are visited BEFORE
      All fields are visited via their "action()" method
      This in turn calls "match()" on the TYPE of the field, which finally leads back to a match of the class definition.
    • action

      public void action(UMod.FieldDef fd)
      Descend to field value:
      1) read object into "model"
      2) set curfd to field
      3) call match on the type
      Overrides:
      action in class UMod.Visitor
    • action

      public void action(UMod.T_reference type)
      Overrides:
      action in class UMod.Visitor
    • action

      public void action(UMod.T_seq type)
      Overrides:
      action in class UMod.Visitor
    • action

      public void action(UMod.T_power type)
      Overrides:
      action in class UMod.Visitor