/** * Add the object without verifying uniqueness. */ @SuppressWarnings("unchecked") public void addUnique(Map.Entry<K, V> object) { ((InternalEList<Map.Entry<K, V>>)(InternalEList<?>)delegateEList).addUnique(object); }
/** * Add the object without verifying uniqueness. */ @SuppressWarnings("unchecked") public void addUnique(int index, Map.Entry<K, V> object) { ((InternalEList<Map.Entry<K, V>>)(InternalEList<?>)delegateEList).addUnique(index, object); }
/** * Add the object without verifying uniqueness. */ @SuppressWarnings("unchecked") public void addUnique(Map.Entry<K, V> object) { ((InternalEList<Map.Entry<K, V>>)(InternalEList<?>)delegateEList).addUnique(object); }
/** * Add the object without verifying uniqueness. */ @SuppressWarnings("unchecked") public void addUnique(int index, Map.Entry<K, V> object) { ((InternalEList<Map.Entry<K, V>>)(InternalEList<?>)delegateEList).addUnique(index, object); }
@Override public void visitEnd() { target.addUnique(result); }
@Override public void visitEnd() { InternalEList<JvmMember> members = (InternalEList<JvmMember>) declarator.getMembers(); members.addUnique(result); }
@Override public void visitEnd() { InternalEList<JvmMember> members = (InternalEList<JvmMember>) declarator.getMembers(); members.addUnique(result); }
public static void copyExportedObject(IResourceDescription from, ResourceDescriptionImpl result) { Iterator<IEObjectDescription> sourceExportedObjects = from.getExportedObjects().iterator(); if (sourceExportedObjects.hasNext()) { InternalEList<IEObjectDescription> targetExportedObjects = (InternalEList<IEObjectDescription>) result.getExportedObjects(); do { targetExportedObjects.addUnique(BuilderStateUtil.create(sourceExportedObjects.next())); } while(sourceExportedObjects.hasNext()); } }
public static void copyReferenceDescriptions(IResourceDescription from, ResourceDescriptionImpl result) { Iterator<IReferenceDescription> sourceReferenceDescriptions = from.getReferenceDescriptions().iterator(); if (sourceReferenceDescriptions.hasNext()) { InternalEList<IReferenceDescription> targetReferenceDescriptions = (InternalEList<IReferenceDescription>) result.getReferenceDescriptions(); do { targetReferenceDescriptions.addUnique(BuilderStateUtil.create(sourceReferenceDescriptions.next())); } while(sourceReferenceDescriptions.hasNext()); } }
protected void setInterfaces(String[] interfaces, Map<String, JvmTypeParameter> typeParameters, InternalEList<JvmTypeReference> result) { if (interfaces != null) { for (int i = 0; i < interfaces.length; i++) { String interfaceName = interfaces[i]; result.addUnique(proxies.createTypeReference(BinarySignatures.createObjectTypeSignature(interfaceName), typeParameters)); } } }
@Override public void visitEnum(String name, String desc, String value) { if (name != null) { throw new IllegalStateException(); } if (result == null) { result = TypesFactory.eINSTANCE.createJvmEnumAnnotationValue(); } JvmEnumerationLiteral enumLiteralProxy = proxies.createEnumLiteral(value, desc); ((InternalEList<JvmEnumerationLiteral>) ((JvmEnumAnnotationValue) result).getValues()).addUnique(enumLiteralProxy); }
@Override public void visitEnum(final String name, final String desc, final String value) { JvmEnumAnnotationValue result = TypesFactory.eINSTANCE.createJvmEnumAnnotationValue(); JvmEnumerationLiteral enumLiteralProxy = proxies.createEnumLiteral(value, desc); ((InternalEList<JvmEnumerationLiteral>) result.getValues()).addUnique(enumLiteralProxy); result.setOperation(proxies.createMethodProxy(annotationType, name)); values.addUnique(result); }
private JvmTypeReference enhanceTypeReference(ParameterizedType parameterizedType, JvmParameterizedTypeReference result) { result.setType(createProxy(parameterizedType.getRawType())); Type[] actualTypeArguments = parameterizedType.getActualTypeArguments(); if (actualTypeArguments.length != 0) { InternalEList<JvmTypeReference> arguments = (InternalEList<JvmTypeReference>)result.getArguments(); for (Type actualTypeArgument : actualTypeArguments) { JvmTypeReference argument = createTypeArgument(actualTypeArgument); arguments.addUnique(argument); } } return result; }
protected void createAnnotationValues(final AnnotatedElement annotated, final JvmAnnotationTarget result) { Annotation[] declaredAnnotations = annotated.getDeclaredAnnotations(); if (declaredAnnotations.length != 0) { InternalEList<JvmAnnotationReference> annotations = (InternalEList<JvmAnnotationReference>)result.getAnnotations(); for (Annotation annotation : declaredAnnotations) { annotations.addUnique(createAnnotationReference(annotation)); } } }
protected void enhanceGenericDeclaration(JvmExecutable result, GenericDeclaration declaration) { TypeVariable<?>[] typeParameters = declaration.getTypeParameters(); if (typeParameters.length != 0) { InternalEList<JvmTypeParameter> jvmTypeParameters = (InternalEList<JvmTypeParameter>)result.getTypeParameters(); for (TypeVariable<?> variable : typeParameters) { jvmTypeParameters.addUnique(createTypeParameter(variable, result)); } } }
protected void createAnnotationValues(final AnnotatedElement annotated, final JvmAnnotationTarget result) { Annotation[] declaredAnnotations = annotated.getDeclaredAnnotations(); if (declaredAnnotations.length != 0) { InternalEList<JvmAnnotationReference> annotations = (InternalEList<JvmAnnotationReference>)result.getAnnotations(); for (Annotation annotation : declaredAnnotations) { annotations.addUnique(createAnnotationReference(annotation)); } } }
@Override public void visitEnd() { if (result == null) { result = TypesFactory.eINSTANCE.createJvmCustomAnnotationValue(); } result.setOperation(proxies.createMethodProxy(annotationType, name)); values.addUnique(result); } };
protected void enhanceGenericDeclaration(JvmExecutable result, GenericDeclaration declaration) { TypeVariable<?>[] typeParameters = declaration.getTypeParameters(); if (typeParameters.length != 0) { InternalEList<JvmTypeParameter> jvmTypeParameters = (InternalEList<JvmTypeParameter>)result.getTypeParameters(); for (TypeVariable<?> variable : typeParameters) { jvmTypeParameters.addUnique(createTypeParameter(variable, result)); } } }
@SuppressWarnings("unchecked") protected void createAndSetProxy(EObject obj, INode node, EReference eRef) { final EObject proxy = createProxy(obj, node, eRef); if (eRef.isMany()) { ((InternalEList<EObject>) obj.eGet(eRef, false)).addUnique(proxy); } else { obj.eSet(eRef, proxy); } }
@Override public AnnotationVisitor visitAnnotation(final String name, final String desc) { JvmAnnotationAnnotationValue annotationValue = TypesFactory.eINSTANCE.createJvmAnnotationAnnotationValue(); InternalEList<JvmAnnotationReference> nestedValues = (InternalEList<JvmAnnotationReference>) annotationValue .getValues(); annotationValue.setOperation(proxies.createMethodProxy(annotationType, name)); JvmAnnotationReferenceBuilder annotation = new JvmAnnotationReferenceBuilder(nestedValues, desc, proxies); values.addUnique(annotationValue); return annotation; }