Skip to content

Method: GenerateAsState()

1: package de.fhdw.wtf.generator.java.generatorModel;
2:
3: import de.fhdw.wtf.generator.java.visitor.GenerateAsStateVisitor;
4: import de.fhdw.wtf.generator.java.visitor.GenerateAsStateVisitorReturn;
5:
6: /**
7: * The GenerateAsState decides whether a UserClass will be generated as java-class or as java-interface containing a
8: * java-class called "Impl".
9: *
10: * If the state ends with "GenerateAsClass" just generate the GenUserClass.
11: *
12: * If the state ends with "GenerateAsInterfaceWithImpl" generate an interface with the name of the GenUserClass and all
13: * public operations, that contains the GenUserClass as private inner class with the name "Impl".
14: */
15: public abstract class GenerateAsState {
16:         
17:         /**
18:          * Constructor of GenUserClassGeneratedAsState.
19:          */
20:         protected GenerateAsState() {
21:                 super();
22:         }
23:         
24:         /**
25:          * Calls the handle method in the given visitor.
26:          *
27:          * @param visitor
28:          * The visitor to handle this type.
29:          */
30:         public abstract void accept(final GenerateAsStateVisitor visitor);
31:         
32:         /**
33:          * Calls the handle method in the given visitor.
34:          *
35:          * @param visitor
36:          * The visitor to handle this type.
37:          * @param <X>
38:          * The returntype of the handle and the accept method.
39:          * @return Returns the result of type <X> that is returned by the handle method.
40:          */
41:         public abstract <X> X accept(GenerateAsStateVisitorReturn<X> visitor);
42: }