/** * PUBLIC: * Removes a Class from the receiver's set of read-only classes. * It is illegal to try to send this method to a nested UnitOfWork. */ public void removeReadOnlyClass(Class theClass) throws ValidationException { if (!canChangeReadOnlySet()) { throw ValidationException.cannotModifyReadOnlyClassesSetAfterUsingUnitOfWork(); } if (this.isNestedUnitOfWork) { throw ValidationException.cannotRemoveFromReadOnlyClassesInNestedUnitOfWork(); } getReadOnlyClasses().remove(theClass); }
/** * PUBLIC: * Removes a Class from the receiver's set of read-only classes. * It is illegal to try to send this method to a nested UnitOfWork. */ @Override public void removeReadOnlyClass(Class theClass) throws ValidationException { if (!canChangeReadOnlySet()) { throw ValidationException.cannotModifyReadOnlyClassesSetAfterUsingUnitOfWork(); } if (this.isNestedUnitOfWork) { throw ValidationException.cannotRemoveFromReadOnlyClassesInNestedUnitOfWork(); } getReadOnlyClasses().remove(theClass); }
/** * PUBLIC: * Removes a Class from the receiver's set of read-only classes. * It is illegal to try to send this method to a nested UnitOfWork. */ public void removeReadOnlyClass(Class theClass) throws ValidationException { if (!canChangeReadOnlySet()) { throw ValidationException.cannotModifyReadOnlyClassesSetAfterUsingUnitOfWork(); } if (isNestedUnitOfWork()) { throw ValidationException.cannotRemoveFromReadOnlyClassesInNestedUnitOfWork(); } getReadOnlyClasses().remove(theClass); }
/** * PUBLIC: * Adds the given Java class to the receiver's set of read-only classes. * Cannot be called after objects have been registered in the unit of work. */ public void addReadOnlyClass(Class theClass) throws ValidationException { if (!canChangeReadOnlySet()) { throw ValidationException.cannotModifyReadOnlyClassesSetAfterUsingUnitOfWork(); } getReadOnlyClasses().add(theClass); ClassDescriptor descriptor = getDescriptor(theClass); // Also mark all subclasses as read-only. if (descriptor.hasInheritance()) { for (Enumeration childEnum = descriptor.getInheritancePolicy().getChildDescriptors().elements(); childEnum.hasMoreElements();) { ClassDescriptor childDescriptor = (ClassDescriptor)childEnum.nextElement(); addReadOnlyClass(childDescriptor.getJavaClass()); } } }
/** * PUBLIC: * Adds the given Java class to the receiver's set of read-only classes. * Cannot be called after objects have been registered in the unit of work. */ public void addReadOnlyClass(Class theClass) throws ValidationException { if (!canChangeReadOnlySet()) { throw ValidationException.cannotModifyReadOnlyClassesSetAfterUsingUnitOfWork(); } getReadOnlyClasses().add(theClass); ClassDescriptor descriptor = getDescriptor(theClass); // Also mark all subclasses as read-only. if (descriptor.hasInheritance()) { for (ClassDescriptor childDescriptor : descriptor.getInheritancePolicy().getChildDescriptors()) { addReadOnlyClass(childDescriptor.getJavaClass()); } } }
/** * PUBLIC: * Adds the given Java class to the receiver's set of read-only classes. * Cannot be called after objects have been registered in the unit of work. */ @Override public void addReadOnlyClass(Class theClass) throws ValidationException { if (!canChangeReadOnlySet()) { throw ValidationException.cannotModifyReadOnlyClassesSetAfterUsingUnitOfWork(); } getReadOnlyClasses().add(theClass); ClassDescriptor descriptor = getDescriptor(theClass); // Also mark all subclasses as read-only. if (descriptor.hasInheritance()) { for (ClassDescriptor childDescriptor : descriptor.getInheritancePolicy().getChildDescriptors()) { addReadOnlyClass(childDescriptor.getJavaClass()); } } }