public void reconcileGenAnnotations(GenBase oldGenBase) { if (!oldGenBase.getGenAnnotations().isEmpty() && eResource() != null && eResource().getResourceSet() != null) { GenAnnotationCopier copier = new GenAnnotationCopier(eResource().getResourceSet(), oldGenBase); Collection<GenAnnotation> genAnnotationsCopy = copier.copyAll(oldGenBase.getGenAnnotations()); copier.copyReferences(); getGenAnnotations().clear(); getGenAnnotations().addAll(genAnnotationsCopy); } }
public void reconcileGenAnnotations(GenBase oldGenBase) { if (!oldGenBase.getGenAnnotations().isEmpty() && eResource() != null && eResource().getResourceSet() != null) { GenAnnotationCopier copier = new GenAnnotationCopier(eResource().getResourceSet(), oldGenBase); Collection<GenAnnotation> genAnnotationsCopy = copier.copyAll(oldGenBase.getGenAnnotations()); copier.copyReferences(); getGenAnnotations().clear(); getGenAnnotations().addAll(genAnnotationsCopy); } }
/** * Returns the GenBase object's GenAnnotation, creating one if necessary. */ public static GenAnnotation findOrCreateGenAnnotation(GenBase genBase, String source) { GenAnnotation genAnnotation = genBase.getGenAnnotation(source); if (genAnnotation == null) { genAnnotation = genBase.getGenModel().createGenAnnotation(); genAnnotation.setSource(source); genBase.getGenAnnotations().add(genAnnotation); } return genAnnotation; } }
public static void setAnnotation(GenBase genBase, String sourceURI, String key, String value) { GenAnnotation genAnnotation = genBase.getGenAnnotation(sourceURI); if (genAnnotation == null) { genAnnotation = GenModelFactory.eINSTANCE.createGenAnnotation(); genAnnotation.setSource(sourceURI); genBase.getGenAnnotations().add(genAnnotation); } genAnnotation.getDetails().put(key, value); }
public static void setAnnotation(GenBase genBase, String sourceURI, String key, String value) { GenAnnotation genAnnotation = genBase.getGenAnnotation(sourceURI); if (genAnnotation == null) { genAnnotation = GenModelFactory.eINSTANCE.createGenAnnotation(); genAnnotation.setSource(sourceURI); genBase.getGenAnnotations().add(genAnnotation); } genAnnotation.getDetails().put(key, value); } }