/** * Retrieves the annotation with the specified source on the specified model * element, optionally creating one on demand if no such annotation exists. * * @param eModelElement * The model element from/on which to retrieve/create the * annotation. * @param source * The source for the (new) annotation. * @param createOnDemand * Whether to create one if no such annotation exists. * @return The (new) annotation. */ public static EAnnotation getEAnnotation(EModelElement eModelElement, String source, boolean createOnDemand) { EAnnotation eAnnotation = eModelElement.getEAnnotation(source); return eAnnotation == null && createOnDemand ? createEAnnotation(eModelElement, source) : eAnnotation; }
/** * Retrieves the annotation with the specified source on the specified model * element, optionally creating one on demand if no such annotation exists. * * @param eModelElement * The model element from/on which to retrieve/create the * annotation. * @param source * The source for the (new) annotation. * @param createOnDemand * Whether to create one if no such annotation exists. * @return The (new) annotation. */ public static EAnnotation getEAnnotation(EModelElement eModelElement, String source, boolean createOnDemand) { EAnnotation eAnnotation = eModelElement.getEAnnotation(source); return eAnnotation == null && createOnDemand ? createEAnnotation(eModelElement, source) : eAnnotation; }