Skip to content

Method: accept(GenClassVisitorException)

1: package de.fhdw.wtf.generator.java.generatorModel;
2:
3: import java.util.Collection;
4:
5: import de.fhdw.wtf.generator.java.visitor.GenClassVisitorException;
6: import de.fhdw.wtf.generator.java.visitor.GenClassVisitorReturn;
7: import de.fhdw.wtf.generator.java.visitor.GenInterfaceClassVisitor;
8: import de.fhdw.wtf.generator.java.visitor.GenInterfaceClassVisitorException;
9: import de.fhdw.wtf.generator.java.visitor.GenInterfaceClassVisitorReturn;
10: import de.fhdw.wtf.generator.java.visitor.GenTypeVisitorException;
11:
12: public abstract class GenInterfaceClass extends GenClass {
13:         
14:         protected GenInterfaceClass(final String name,
15:                         final Collection<GenJavaOperation> operations,
16:                         final Collection<GenInterfaceClass> implement,
17:                         final GenPackage packag,
18:                         final GenComment comment,
19:                         final String nonGeneratedPart) {
20:                 super(name, operations, implement, packag, comment, nonGeneratedPart);
21:         }
22:         
23:         @Override
24:         public void accept(final de.fhdw.wtf.generator.java.visitor.GenClassVisitor visitor) {
25:                 visitor.handle(this);
26:                 
27:         }
28:         
29:         @Override
30:         public <X> X accept(final GenClassVisitorReturn<X> visitor) {
31:                 return visitor.handle(this);
32:         }
33:         
34:         @Override
35:         public <X extends java.lang.Exception> void accept(final GenClassVisitorException<X> visitor) throws X {
36:                 visitor.handle(this);
37:                 
38:         }
39:         
40:         @Override
41:         public <X extends java.lang.Exception> void accept(final GenTypeVisitorException<X> visitor) throws X {
42:                 visitor.handle(this);
43:         }
44:         
45:         /**
46:          * Calls the handle method in the given visitor.
47:          *
48:          * @param visitor
49:          * The visitor to handle this type.
50:          */
51:         public abstract void accept(GenInterfaceClassVisitor visitor);
52:         
53:         /**
54:          * Calls the handle method in the given visitor.
55:          *
56:          * @param visitor
57:          * The visitor to handle this type.
58:          * @param <X>
59:          * The returntype of the handle and the accept method.
60:          * @return Returns the result of type <X> that is returned by the handle method.
61:          */
62:         public abstract <X> X accept(GenInterfaceClassVisitorReturn<X> visitor);
63:         
64:         /**
65:          * Calls the handle method in the given visitor.
66:          *
67:          * @param visitor
68:          * The visitor to handle this type.
69:          * @param <Y>
70:          * The exception that can be thrown by the handle method.
71:          * @throws Y
72:          * Throws an exception of type <X> when the handle method throws it.
73:          */
74:         public abstract <Y extends java.lang.Exception> void accept(GenInterfaceClassVisitorException<Y> visitor) throws Y;
75:         
76: }