blob: 2a8838eb9f7cb14304cbe1d867338a77ccd85173 [file] [log] [blame]
<%if (genModel.isArrayAccessors() && genFeature.isListType() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) { String arrayElementType = genFeature.getArrayItemType(genClass);%>
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @generated
*/
<%if (!isImplementation) {%>
<%=arrayElementType%>[] <%=genFeature.getGetArrayAccessor()%>();
<%} else {%>
<%if (genModel.useGenerics() && CodeGenUtil.isUncheckedCast(arrayElementType)) {%>
@SuppressWarnings("unchecked")
<%}%>
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%if (useInterfaceOverrideAnnotation) {%>
@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();
}
<%}%>
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @generated
*/
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%if (!isImplementation) {%>
<%=genFeature.getListItemType(genClass)%> get<%=genFeature.getAccessorName()%>(int index);
<%} else {%>
<%if (useInterfaceOverrideAnnotation) {%>
@Override
<%}%>
public <%=genFeature.getListItemType(genClass)%> get<%=genFeature.getAccessorName()%>(int index)
{
return <%if (!genModel.useGenerics()) {%>(<%=genFeature.getListItemType(genClass)%>)<%}%><%=genFeature.getGetAccessor()%>().get(index);
}
<%}%>
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @generated
*/
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%if (!isImplementation) {%>
int get<%=genFeature.getAccessorName()%>Length();
<%} else {%>
<%if (useInterfaceOverrideAnnotation) {%>
@Override
<%}%>
public int get<%=genFeature.getAccessorName()%>Length()
{
<%if (genFeature.isVolatile()) {%>
return <%=genFeature.getGetAccessor()%>().size();
<%} else {%>
return <%=genFeature.getSafeName()%> == null ? 0 : <%=genFeature.getSafeName()%>.size();
<%}%>
}
<%}%>
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @generated
*/
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%if (!isImplementation) {%>
void set<%=genFeature.getAccessorName()%>(<%=genFeature.getListItemType(genClass)%>[] new<%=genFeature.getCapName()%>);
<%} else {%>
<%if (useInterfaceOverrideAnnotation) {%>
@Override
<%}%>
public void set<%=genFeature.getAccessorName()%>(<%=genFeature.getListItemType(genClass)%>[] new<%=genFeature.getCapName()%>)
{
((<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%>)<%=genFeature.getGetAccessor()%>()).setData(new<%=genFeature.getCapName()%>.length, new<%=genFeature.getCapName()%>);
}
<%}%>
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
<%if (genFeature.hasAPITags()) {%>
* <%=genFeature.getAPITags(genModel.getIndentation(stringBuffer))%>
<%}%>
* @generated
*/
<%if (isJDK50 && genFeature.hasAPIDeprecatedTag()) {%>
@Deprecated
<%}%>
<%if (!isImplementation) {%>
void set<%=genFeature.getAccessorName()%>(int index, <%=genFeature.getListItemType(genClass)%> element);
<%} else {%>
<%if (useInterfaceOverrideAnnotation) {%>
@Override
<%}%>
public void set<%=genFeature.getAccessorName()%>(int index, <%=genFeature.getListItemType(genClass)%> element)
{
<%=genFeature.getGetAccessor()%>().set(index, element);
}
<%}%>
<%}%>
<%if (genFeature.isGet() && (isImplementation || !genFeature.isSuppressedGetVisibility())) {%>
<%@ 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.override" 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"%><%//Class/getGenFeature.override.javajetinc%>
<%}%>
<%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicGet()) {%>
<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.model.call.Class.Class.basicGetGenFeature.override" 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"%><%//Class/basicGetGenFeature.override.javajetinc%>
<%}%>
<%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicSet()) {%>
<%@ 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.override" 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"%><%//Class/basicSetGenFeature.override.javajetinc%>
<%}%>
<%if (genFeature.isSet() && (isImplementation || !genFeature.isSuppressedSetVisibility())) {%>
<%@ 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.override" 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"%><%//Class/setGenFeature.override.javajetinc%>
<%}%>
<%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicUnset()) {%>
<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.model.call.Class.Class.basicUnsetGenFeature.override" 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"%><%//Class.basicUnsetGenFeature.override.javajetinc%>
<%}%>
<%if (genFeature.isUnset() && (isImplementation || !genFeature.isSuppressedUnsetVisibility())) {%>
<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.model.call.Class.Class.unsetGenFeature.override" 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"%><%//Class/unsetGenFeature.override.javajetinc%>
<%}%>
<%if (genFeature.isIsSet() && (isImplementation || !genFeature.isSuppressedIsSetVisibility())) {%>
<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern/egf/EMF_Pattern.fcore#LogicalName=org.eclipse.egf.emf.pattern.model.call.Class.Class.isSetGenFeature.override" 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"%><%//Class/isSetGenFeature.override.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.genFeature.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"%>