| |
| |
| <%if (genModel.isArrayAccessors() && genFeature.isListType() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) { String arrayElementType = genFeature.getArrayItemType(genClass);%> |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * This is specialized for the more specific element type known in this context. |
| * @generated |
| */ |
| <%if (genModel.useGenerics() && CodeGenUtil.isUncheckedCast(arrayElementType)) {%> |
| @SuppressWarnings("unchecked") |
| <%}%> |
| <%if (classExtendsAllGenFeatures.contains(genFeature)) {%> |
| @Override |
| <%}%> |
| public <%=arrayElementType%>[] <%=genFeature.getGetArrayAccessor()%>() |
| { |
| <%if (genFeature.isVolatile()) {%> |
| <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%> list = (<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%>)<%=genFeature.getGetAccessor()%>(); |
| if (list.isEmpty()) return <%=genFeature.getUpperName()%>_EEMPTY_ARRAY; |
| <%} else {%> |
| if (<%=genFeature.getSafeName()%> == null || <%=genFeature.getSafeName()%>.isEmpty()) return <%=genFeature.getUpperName()%>_EEMPTY_ARRAY; |
| <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%> list = (<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%>)<%=genFeature.getSafeName()%>; |
| <%}%> |
| list.shrink(); |
| return (<%=arrayElementType%>[])list.data(); |
| } |
| |
| <%}%> |
| <%if (genFeature.isGet() && genFeature.isListType()) {%> |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * This is specialized for the more specific element type known in this context. |
| * @generated |
| */ |
| <%if (isJDK50) { //Class/getGenFeature.annotations.insert.javajetinc%> |
| <%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.model.call.Class.Class.getGenFeature.annotations.insert" args="genFeature:genFeature,genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,isInterface:isInterface,isImplementation:isImplementation,isGWT:isGWT,publicStaticFinalFlag:publicStaticFinalFlag,singleWildcard:singleWildcard,negativeOffsetCorrection:negativeOffsetCorrection,positiveOffsetCorrection:positiveOffsetCorrection,negativeOperationOffsetCorrection:negativeOperationOffsetCorrection,positiveOperationOffsetCorrection:positiveOperationOffsetCorrection"%> |
| <%}%> |
| <%if (genFeature.isListType() && genModel.isVirtualDelegation()) {%> |
| @SuppressWarnings("unchecked") |
| <%}%> |
| <%if (classExtendsAllGenFeatures.contains(genFeature)) {%> |
| @Override |
| <%}%> |
| public <%=genFeature.getImportedType(genClass)%> <%=genFeature.getGetAccessor()%><%if (genClass.hasCollidingGetAccessorOperation(genFeature)) {%>_<%}%>() |
| { |
| <%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.model.call.Class.Class.getGenFeature.pre.insert" args="genFeature:genFeature,genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,isInterface:isInterface,isImplementation:isImplementation,isGWT:isGWT,publicStaticFinalFlag:publicStaticFinalFlag,singleWildcard:singleWildcard,negativeOffsetCorrection:negativeOffsetCorrection,positiveOffsetCorrection:positiveOffsetCorrection,negativeOperationOffsetCorrection:negativeOperationOffsetCorrection,positiveOperationOffsetCorrection:positiveOperationOffsetCorrection"%> |
| <%if (genModel.isVirtualDelegation()) {%> |
| <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>); |
| <%}%> |
| if (<%=genFeature.getSafeName()%> == null) |
| { |
| <%if (genModel.isVirtualDelegation()) {%> |
| eVirtualSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%=genFeature.getSafeName()%> = new <%=genClass.getListConstructor(genFeature)%>); |
| <%} else {%> |
| <%=genFeature.getSafeName()%> = new <%=genClass.getListConstructor(genFeature)%>; |
| <%}%> |
| } |
| return <%=genFeature.getSafeName()%><%=genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes() ? ".map()" : ""%>; |
| } |
| |
| <%}%> |
| <%if (!genModel.isReflectiveDelegation() && genFeature.isBasicSet()) {%> |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * This is specialized for the more specific type known in this context. |
| * @generated |
| */ |
| <%if (isJDK50) { //Class/basicSetGenFeature.annotations.insert.javajetinc%> |
| <%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.model.call.Class.Class.basicSetGenFeature.annotations.insert" args="genFeature:genFeature,genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,isInterface:isInterface,isImplementation:isImplementation,isGWT:isGWT,publicStaticFinalFlag:publicStaticFinalFlag,singleWildcard:singleWildcard,negativeOffsetCorrection:negativeOffsetCorrection,positiveOffsetCorrection:positiveOffsetCorrection,negativeOperationOffsetCorrection:negativeOperationOffsetCorrection,positiveOperationOffsetCorrection:positiveOperationOffsetCorrection"%> |
| <%}%> |
| <%if (classExtendsAllGenFeatures.contains(genFeature)) {%> |
| @Override |
| <%}%> |
| public <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> basicSet<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedInternalType(genClass)%> new<%=genFeature.getCapName()%>, <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs) |
| { |
| return super.basicSet<%=genFeature.getAccessorName()%>(new<%=genFeature.getCapName()%>, msgs); |
| } |
| |
| <%}%> |
| <%if (genFeature.isSet() && !(!genModel.isReflectiveDelegation() && genFeature.isBasicSet())) {%> |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * This is specialized for the more specific type known in this context. |
| * @generated |
| */ |
| <%if (isJDK50) { //Class/setGenFeature.annotations.insert.javajetinc%> |
| <%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.model.call.Class.Class.setGenFeature.annotations.insert" args="genFeature:genFeature,genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,isInterface:isInterface,isImplementation:isImplementation,isGWT:isGWT,publicStaticFinalFlag:publicStaticFinalFlag,singleWildcard:singleWildcard,negativeOffsetCorrection:negativeOffsetCorrection,positiveOffsetCorrection:positiveOffsetCorrection,negativeOperationOffsetCorrection:negativeOperationOffsetCorrection,positiveOperationOffsetCorrection:positiveOperationOffsetCorrection"%> |
| <%}%> |
| <%{ GenOperation setAccessorOperation = genClass.getSetAccessorOperation(genFeature);%> |
| <%if (classExtendsAllGenFeatures.contains(genFeature)) {%> |
| @Override |
| <%}%> |
| public void set<%=genFeature.getAccessorName()%><%if (genClass.hasCollidingSetAccessorOperation(genFeature)) {%>_<%}%>(<%=genFeature.getImportedType(genClass)%> <%=setAccessorOperation == null ? "new" + genFeature.getCapName() : setAccessorOperation.getGenParameters().get(0).getName()%>) |
| { |
| super.set<%=genFeature.getAccessorName()%><%if (genClass.hasCollidingSetAccessorOperation(genFeature)) {%>_<%}%>(<%=setAccessorOperation == null ? "new" + genFeature.getCapName() : setAccessorOperation.getGenParameters().get(0).getName()%>); |
| } |
| |
| <%}%> |
| <%}%> |