protected void addAnnotation(ENamedElement eNamedElement, int depth, String source, String [] details, URI [] references) { EAnnotation eAnnotation = ecoreFactory.createEAnnotation(); eAnnotation.setSource(source); EMap<String, String> theDetails = eAnnotation.getDetails(); for (int i = 1; i < details.length; i += 2) { theDetails.put(details[i - 1], details[i]); } EList<EAnnotation> annotations = eNamedElement.getEAnnotations(); for (int i = 0; i < depth; ++i) { @SuppressWarnings("unchecked") EList<EAnnotation> childAnnotations = (EList<EAnnotation>)(EList<?>)annotations.get(annotations.size() - 1).getContents(); annotations = childAnnotations; } annotations.add(eAnnotation); if (references != null) { InternalEList<EObject> eAnnotationReferences = (InternalEList<EObject>)eAnnotation.getReferences(); for (URI reference : references) { InternalEObject internalEObject = (InternalEObject)ecoreFactory.createEObject(); internalEObject.eSetProxyURI(reference); eAnnotationReferences.addUnique(internalEObject); } } }
protected void addAnnotation(ENamedElement eNamedElement, int depth, String source, String [] details, URI [] references) { EAnnotation eAnnotation = ecoreFactory.createEAnnotation(); eAnnotation.setSource(source); EMap<String, String> theDetails = eAnnotation.getDetails(); for (int i = 1; i < details.length; i += 2) { theDetails.put(details[i - 1], details[i]); } EList<EAnnotation> annotations = eNamedElement.getEAnnotations(); for (int i = 0; i < depth; ++i) { @SuppressWarnings("unchecked") EList<EAnnotation> childAnnotations = (EList<EAnnotation>)(EList<?>)annotations.get(annotations.size() - 1).getContents(); annotations = childAnnotations; } annotations.add(eAnnotation); if (references != null) { InternalEList<EObject> eAnnotationReferences = (InternalEList<EObject>)eAnnotation.getReferences(); for (URI reference : references) { InternalEObject internalEObject = (InternalEObject)ecoreFactory.createEObject(); internalEObject.eSetProxyURI(reference); eAnnotationReferences.addUnique(internalEObject); } } }
for (URI reference : references) InternalEObject internalEObject = (InternalEObject)ecoreFactory.createEObject(); internalEObject.eSetProxyURI(reference); eAnnotationReferences.addUnique(internalEObject);
for (URI reference : references) InternalEObject internalEObject = (InternalEObject)ecoreFactory.createEObject(); internalEObject.eSetProxyURI(reference); eAnnotationReferences.addUnique(internalEObject);