blob: fbe94e807143838229744b169c4c19c6d6020446 [file] [log] [blame]
<%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.
* @see #<%=genFeature.getGetAccessor()%>()
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @generated
*/
<%if (genModel.useGenerics() && CodeGenUtil.isUncheckedCast(arrayElementType)) {%>
@SuppressWarnings("unchecked")
<%}%>
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%if (useInterfaceOverrideAnnotation || 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.
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @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.Interface.Interface.getGenFeature.annotations.insert" args="genFeature:genFeature,genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,isInterface:isInterface,isImplementation:isImplementation,useInterfaceOverrideAnnotation:useInterfaceOverrideAnnotation,isGWT:isGWT,forceDefaultCase:forceDefaultCase,indentDefaultCase:indentDefaultCase,publicStaticFinalFlag:publicStaticFinalFlag,singleWildcard:singleWildcard,negativeOffsetCorrection:negativeOffsetCorrection,positiveOffsetCorrection:positiveOffsetCorrection,negativeOperationOffsetCorrection:negativeOperationOffsetCorrection,positiveOperationOffsetCorrection:positiveOperationOffsetCorrection"%>
<%}%>
<%if (genFeature.isListType() && genModel.isVirtualDelegation()) {%>
@SuppressWarnings("unchecked")
<%}%>
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%if (useInterfaceOverrideAnnotation || 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.Interface.Interface.getGenFeature.pre.insert" args="genFeature:genFeature,genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,isInterface:isInterface,isImplementation:isImplementation,useInterfaceOverrideAnnotation:useInterfaceOverrideAnnotation,isGWT:isGWT,forceDefaultCase:forceDefaultCase,indentDefaultCase:indentDefaultCase,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.
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @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.Interface.Interface.basicSetGenFeature.annotations.insert" args="genFeature:genFeature,genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,isInterface:isInterface,isImplementation:isImplementation,useInterfaceOverrideAnnotation:useInterfaceOverrideAnnotation,isGWT:isGWT,forceDefaultCase:forceDefaultCase,indentDefaultCase:indentDefaultCase,publicStaticFinalFlag:publicStaticFinalFlag,singleWildcard:singleWildcard,negativeOffsetCorrection:negativeOffsetCorrection,positiveOffsetCorrection:positiveOffsetCorrection,negativeOperationOffsetCorrection:negativeOperationOffsetCorrection,positiveOperationOffsetCorrection:positiveOperationOffsetCorrection"%>
<%}%>
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%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.
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @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.Interface.Interface.setGenFeature.annotations.insert" args="genFeature:genFeature,genClass:genClass,genPackage:genPackage,genModel:genModel,isJDK50:isJDK50,isInterface:isInterface,isImplementation:isImplementation,useInterfaceOverrideAnnotation:useInterfaceOverrideAnnotation,isGWT:isGWT,forceDefaultCase:forceDefaultCase,indentDefaultCase:indentDefaultCase,publicStaticFinalFlag:publicStaticFinalFlag,singleWildcard:singleWildcard,negativeOffsetCorrection:negativeOffsetCorrection,positiveOffsetCorrection:positiveOffsetCorrection,negativeOperationOffsetCorrection:negativeOperationOffsetCorrection,positiveOperationOffsetCorrection:positiveOperationOffsetCorrection"%>
<%}%>
<%{ GenOperation setAccessorOperation = genClass.getSetAccessorOperation(genFeature);%>
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%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()%>);
}
<%}%>
<%}%>