stringBuffer.append(TEXT_3); {GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null; if (copyrightHolder != null && copyrightHolder.hasCopyright()) { stringBuffer.append(TEXT_4); stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer))); }} stringBuffer.append(TEXT_5);
/** * Returns the container of the given object if it is a GenModel element, and null otherwise. */ protected Object getParent(Object object) { Object result = ((GenBase)object).eContainer(); return result instanceof GenBase ? result : null; }
/** * 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); } }
@Override public GenModel getGenModel() { // We can't blindly cache the genModel, since we need to support moving the GenPackage to another container, // but the cast is expensive, so we'd like to do it no more than absolutely necessary. // if (eContainerFeatureID == GenModelPackage.GEN_PACKAGE__GEN_MODEL) { genBaseContainer = null; if (eContainer != genModelContainer) { genModelContainer = (GenModel)eContainer; } return genModelContainer; } genModelContainer = null; if (eContainer != genBaseContainer) { genBaseContainer = (GenBase)eContainer; } return genBaseContainer != null ? genBaseContainer.getGenModel() : null; }
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 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); } }
@Override protected EObject getEObject(Object element) { return element instanceof GenBase ? ((GenBase)element).getEcoreModelElement() : null; } };
/** * Delegates to the GenModel element's {@link GenBase#canGenerateEditor() canGenerateEditor()} method. */ public boolean canGenerateEditor(Object object) { return ((GenBase)object).canGenerateEditor(); }
/** * Delegates to the GenModel element's {@link GenBase#canGenerateTests() canGenerateTests()} method. */ public boolean canGenerateTests(Object object) { return ((GenBase)object).canGenerateTests(); }
/** * Delegates to the GenMoel element's {@link GenBase#canGenerate() canGenerate()} method. */ public boolean canGenerateModel(Object object) { return ((GenBase)object).canGenerate(); }
/** * Delegates to the GenMoel element's {@link GenBase#canGenerateEdit() canGenerateEdit()} method. */ public boolean canGenerateEdit(Object object) { return ((GenBase)object).canGenerateEdit(); }
@Override public GenModel getGenModel() { // We can't blindly cache the genModel, since we need to support moving the GenPackage to another container, // but the cast is expensive, so we'd like to do it no more than absolutely necessary. // if (eContainerFeatureID == GenModelPackage.GEN_PACKAGE__GEN_MODEL) { genBaseContainer = null; if (eContainer != genModelContainer) { genModelContainer = (GenModel)eContainer; } return genModelContainer; } genModelContainer = null; if (eContainer != genBaseContainer) { genBaseContainer = (GenBase)eContainer; } return genBaseContainer.getGenModel(); }
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 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); } }
@Override protected boolean validate_DataValueConforms(EObject eObject, EAttribute eAttribute, DiagnosticChain diagnostics, Map<Object, Object> context) { boolean result = super.validate_DataValueConforms(eObject, eAttribute, diagnostics, context); if (result && eAttribute.getEType() == GenModelPackage.Literals.PROPERTY_EDITOR_FACTORY) { String propertyEditorFactory = (String)eObject.eGet(eAttribute); result = validatePropertyEditorFactory(((GenBase)eObject).getEcoreModelElement(), propertyEditorFactory, diagnostics, context); } return result; }
/** * Delegates to the GenMoel element's {@link GenBase#canGenerateEditor() canGenerateEditor()} method. */ public boolean canGenerateEditor(Object object) { return ((GenBase)object).canGenerateEditor(); }
/** * Delegates to the GenMoel element's {@link GenBase#canGenerateTests() canGenerateTests()} method. */ public boolean canGenerateTests(Object object) { return ((GenBase)object).canGenerateTests(); }
/** * Delegates to the GenModel element's {@link GenBase#canGenerate() canGenerate()} method. */ public boolean canGenerateModel(Object object) { return ((GenBase)object).canGenerate(); }