Package eu.bandm.tools.umod
Class ReflectiveVisitor
java.lang.Object
eu.bandm.tools.umod.UMod.Visitor
eu.bandm.tools.umod.ReflectiveVisitor
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
The currently visited object is stored in
model
,
the XXX-
Field Summary
Modifier and TypeFieldDescriptionprotected UMod.ClassDef
protected UMod.FieldDef
protected UMod.Forest
protected Object
protected static final Object[]
protected static final Class[]
Fields inherited from class eu.bandm.tools.umod.UMod.Visitor
result
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
action
(UMod.ClassDef cd) Is possibly called MORE THAN once for each object.void
action
(UMod.FieldDef fd) Descend to field value:
1) read object into "model"
2) set curfd to field
3) call match on the typevoid
action
(UMod.T_power type) void
action
(UMod.T_reference type) void
action
(UMod.T_seq type) static Object
getFieldValue
(Object o, UMod.FieldDef fd) Reads the content of a given field by applying java.lang.reflect methods.Finds the most specialized UMOd class definition for a certain object.void
matchModel
(UMod.ClassDef cd, Object o) void
Action for each model object, may be over-ridden by user of this Visitor.protected void
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.Methods inherited from class eu.bandm.tools.umod.UMod.Visitor
action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, descend_Forest$extBySequence, getResult, match
-
Field Details
-
curforest
-
curcd
-
curfd
-
referingObject
-
referingField
-
model
-
visited
-
NO_PARAMS
-
NO_ARGS
-
-
Constructor Details
-
ReflectiveVisitor
-
-
Method Details
-
matchModel
-
getFieldValue
Reads the content of a given field by applying java.lang.reflect methods. -
getSpecialization
Finds the most specialized UMOd class definition for a certain object. Uses the naming! -
modelAction
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
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 classUMod.Visitor
-
visitFields
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
Descend to field value:
1) read object into "model"
2) set curfd to field
3) call match on the type- Overrides:
action
in classUMod.Visitor
-
action
- Overrides:
action
in classUMod.Visitor
-
action
- Overrides:
action
in classUMod.Visitor
-
action
- Overrides:
action
in classUMod.Visitor
-