View Javadoc

1   /**
2    * (c) Mod4j and contributors
3    *
4    * $Id$
5    */
6   package org.mod4j.crossx.mm.crossx.impl;
7   
8   import org.eclipse.emf.common.notify.Notification;
9   
10  import org.eclipse.emf.ecore.EClass;
11  
12  import org.eclipse.emf.ecore.impl.ENotificationImpl;
13  
14  import org.mod4j.crossx.mm.crossx.CrossxPackage;
15  import org.mod4j.crossx.mm.crossx.LiteralSymbolProperty;
16  
17  /**
18   * <!-- begin-user-doc -->
19   * An implementation of the model object '<em><b>Literal Symbol Property</b></em>'.
20   * <!-- end-user-doc -->
21   * <p>
22   * The following features are implemented:
23   * <ul>
24   *   <li>{@link org.mod4j.crossx.mm.crossx.impl.LiteralSymbolPropertyImpl#getValue <em>Value</em>}</li>
25   * </ul>
26   * </p>
27   *
28   * @generated
29   */
30  public class LiteralSymbolPropertyImpl extends SymbolPropertyImpl implements LiteralSymbolProperty {
31      /**
32       * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
33       * <!-- begin-user-doc -->
34       * <!-- end-user-doc -->
35       * @see #getValue()
36       * @generated
37       * @ordered
38       */
39      protected static final String VALUE_EDEFAULT = null;
40  
41      /**
42       * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
43       * <!-- begin-user-doc -->
44       * <!-- end-user-doc -->
45       * @see #getValue()
46       * @generated
47       * @ordered
48       */
49      protected String value = VALUE_EDEFAULT;
50  
51      /**
52       * <!-- begin-user-doc -->
53       * <!-- end-user-doc -->
54       * @generated
55       */
56      protected LiteralSymbolPropertyImpl() {
57          super();
58      }
59  
60      /**
61       * <!-- begin-user-doc -->
62       * <!-- end-user-doc -->
63       * @generated
64       */
65      @Override
66      protected EClass eStaticClass() {
67          return CrossxPackage.Literals.LITERAL_SYMBOL_PROPERTY;
68      }
69  
70      /**
71       * <!-- begin-user-doc -->
72       * <!-- end-user-doc -->
73       * @generated
74       */
75      public String getValue() {
76          return value;
77      }
78  
79      /**
80       * <!-- begin-user-doc -->
81       * <!-- end-user-doc -->
82       * @generated
83       */
84      public void setValue(String newValue) {
85          String oldValue = value;
86          value = newValue;
87          if (eNotificationRequired())
88              eNotify(new ENotificationImpl(this, Notification.SET, CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE, oldValue, value));
89      }
90  
91      /**
92       * <!-- begin-user-doc -->
93       * <!-- end-user-doc -->
94       * @generated
95       */
96      @Override
97      public Object eGet(int featureID, boolean resolve, boolean coreType) {
98          switch (featureID) {
99              case CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE:
100                 return getValue();
101         }
102         return super.eGet(featureID, resolve, coreType);
103     }
104 
105     /**
106      * <!-- begin-user-doc -->
107      * <!-- end-user-doc -->
108      * @generated
109      */
110     @Override
111     public void eSet(int featureID, Object newValue) {
112         switch (featureID) {
113             case CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE:
114                 setValue((String)newValue);
115                 return;
116         }
117         super.eSet(featureID, newValue);
118     }
119 
120     /**
121      * <!-- begin-user-doc -->
122      * <!-- end-user-doc -->
123      * @generated
124      */
125     @Override
126     public void eUnset(int featureID) {
127         switch (featureID) {
128             case CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE:
129                 setValue(VALUE_EDEFAULT);
130                 return;
131         }
132         super.eUnset(featureID);
133     }
134 
135     /**
136      * <!-- begin-user-doc -->
137      * <!-- end-user-doc -->
138      * @generated
139      */
140     @Override
141     public boolean eIsSet(int featureID) {
142         switch (featureID) {
143             case CrossxPackage.LITERAL_SYMBOL_PROPERTY__VALUE:
144                 return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
145         }
146         return super.eIsSet(featureID);
147     }
148 
149     /**
150      * <!-- begin-user-doc -->
151      * <!-- end-user-doc -->
152      * @generated
153      */
154     @Override
155     public String toString() {
156         if (eIsProxy()) return super.toString();
157 
158         StringBuffer result = new StringBuffer(super.toString());
159         result.append(" (value: ");
160         result.append(value);
161         result.append(')');
162         return result.toString();
163     }
164 
165 } //LiteralSymbolPropertyImpl