View Javadoc

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