/** * Constructs a new {@code ClassBean} for the represented {@code reference}. * * @param reference the represented {@link EClass} */ private ClassBean(EClass reference) { this(reference.getName(), reference.getEPackage().getNsURI()); lazyClass.update(reference); }
@Nonnull @Override public BasicNamespace setReal(EPackage ePackage) { checkNotNull(ePackage, "ePackage"); this.ePackage.update(ePackage); return this; }
/** * Removes the containing edge. */ public void removeContainingEdge() { getContainingEdge().ifPresent(ContainingEdge::remove); lazyContainingEdge.update(null); }
@Nonnull @Override public BasicClass setReal(EClass eClass) { checkNotNull(eClass, "eClass"); this.eClass.update(eClass); return setName(eClass.getName()); }
/** * Constructs a new {@code BasicClass} from the represented meta-class. * * @param eClass the represented meta-class */ public BasicClass(EClass eClass) { this(BasicNamespace.Registry.getInstance().get(eClass.getEPackage()), eClass.getName()); this.eClass.update(eClass); }
/** * Defines the containing edge from the specified {@code bean}. * * @param bean the simple representation of the containing edge */ public void setContainingEdge(SingleFeatureBean bean) { // Remove the existing container, if defined removeContainingEdge(); // Link this vertex with its container ContainingEdge edge = ContainingEdge.create(graph, this, bean); lazyContainingEdge.update(edge); }
/** * Defines the meta-class vertex from the specified {@code bean}. If the meta-class is already defined, then this * method does nothing. * * @param bean the simple representation of the meta-class vertex * * @return {@code true} if the meta-class has been defined for this vertex, {@code false} if the meta-class was * already defined */ public boolean setClassVertex(ClassBean bean) { if (getClassVertex().isPresent()) { // The meta-class is already defined return false; } // Retrieve or create the meta-class vertex ClassVertex classVertex = ClassVertex.getOrCreate(graph, bean); lazyClassVertex.update(classVertex); // Link this vertex with its meta-class InstanceOfEdge.create(graph, this, classVertex); return true; }
@Override protected void eBasicSetContainer(@Nullable InternalEObject newContainer, int newContainerFeatureID) { if (nonNull(newContainer)) { PersistentEObject container = PersistentEObject.from(newContainer); EReference containmentFeature = eContainmentFeature(this, container, newContainerFeatureID); lazyContainer.update(container); eStore().updateContainment(this, containmentFeature, container); resource(container.resource()); } else { lazyContainer.update(null); eStore().removeContainment(this); resource(null); } }