Skip to content

Method: getVisibility()

1: package de.fhdw.wtf.generator.java.generatorModel;
2:
3: import java.util.Collection;
4:
5: import de.fhdw.wtf.generator.java.visitor.GenAttributeVisitorReturn;
6:
7: public abstract class GenAttribute extends GenClassMember {
8:         
9:         private GenTypeReference typ;
10:         private GenVisibility visibility;
11:         
12:         public void setTyp(final GenTypeReference typ) {
13:                 this.typ = typ;
14:         }
15:         
16:         /**
17:          * Calls the handle method in the given visitor.
18:          *
19:          * @param visitor
20:          * The visitor to handle this type.
21:          * @param <X>
22:          * The returntype of the handle and the accept method.
23:          * @return Returns the result of type <X> that is returned by the handle method.
24:          */
25:         public abstract <X> X accept(GenAttributeVisitorReturn<X> visitor);
26:         
27:         private final Collection<GenAttributeModifier> modifiers;
28:         
29:         protected GenAttribute(final String name,
30:                         final GenVisibility visibility,
31:                         final GenTypeReference typ,
32:                         final Collection<GenAttributeModifier> modifiers) {
33:                 super(name);
34:                 this.typ = typ;
35:                 this.modifiers = modifiers;
36:                 this.setVisibility(visibility);
37:         }
38:         
39:         /**
40:          * Projections.
41:          *
42:          * @return type reference
43:          */
44:         public GenTypeReference getTyp() {
45:                 return this.typ;
46:         }
47:         
48:         public Collection<GenAttributeModifier> getModifiers() {
49:                 return this.modifiers;
50:         }
51:         
52:         public GenVisibility getVisibility() {
53:                 return this.visibility;
54:         }
55:         
56:         public void setVisibility(final GenVisibility visibility) {
57:                 this.visibility = visibility;
58:         }
59:         
60:         public void setTyp(final de.fhdw.wtf.generator.java.generatorModel.GenType type) {
61:                 this.typ = GenTypeReferenceByReference.create(type);
62:         }
63:         
64: }