/** * 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 String getAnnotation(GenBase genBase, String sourceURI, String key) { GenAnnotation genAnnotation = genBase.getGenAnnotation(sourceURI); return genAnnotation == null ? null : (String)genAnnotation.getDetails().get(key); }
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 String getAnnotation(GenBase genBase, String sourceURI, String key) { GenAnnotation genAnnotation = genBase.getGenAnnotation(sourceURI); return genAnnotation == null ? null : (String)genAnnotation.getDetails().get(key); }
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); }
protected List<GenAnnotation> getExporterNestedGenAnnotations(GenBase genBase) { if (genBase != null) { GenAnnotation exportAnnotation = genBase.getGenAnnotation(getConverterGenAnnotationSource()); if (exportAnnotation != null && !exportAnnotation.getGenAnnotations().isEmpty()) { List<GenAnnotation> nestedAnnotations = exportAnnotation.getGenAnnotations(); if (nestedAnnotations != null) { return nestedAnnotations; } } } return Collections.emptyList(); }
protected EMap<String, String> getExporterNestedGenAnnotationDetails(GenBase genBase, String nestedGenAnnotationSource) { GenAnnotation genAnnotation = genBase.getGenAnnotation(getConverterGenAnnotationSource()); if (genAnnotation != null) { GenAnnotation nestedGenAnnotation = genAnnotation.getGenAnnotation(nestedGenAnnotationSource); if (nestedGenAnnotation != null) { return nestedGenAnnotation.getDetails(); } } return ECollections.emptyEMap(); }
/** * Returns the {@link GenBase} object's {@link GenAnnotation} Details map * associated with this Model Exporter or {@link ECollections#EMPTY_EMAP} */ protected EMap<String, String> getExporterGenAnnotationDetails(GenBase genBase) { EMap<String, String> eMap = getGenBaseToGenAnnotationDetailsMap().get(genBase); if (eMap == null) { GenAnnotation genAnnotation = genBase.getGenAnnotation(getConverterGenAnnotationSource()); if (genAnnotation != null) { eMap = genAnnotation.getDetails(); getGenBaseToGenAnnotationDetailsMap().put(genBase, eMap); } else { eMap = ECollections.emptyEMap(); } } return eMap; }