/** * Replaces serializing object. Overrides superclass method. Adds checking * for object validity. In case this object is invalid * throws {@link java.io.NotSerializableException NotSerializableException}. * @throws ObjectStreamException When problem during serialization occures. * @throws NotSerializableException When this <code>CloneableEditor</code> * is invalid and doesn't want to be serialized. */ @Override protected Object writeReplace() throws ObjectStreamException { if (discard()) { throw new NotSerializableException("Serializing component is invalid: " + this); // NOI18N } return super.writeReplace(); }
/** * Replaces serializing object. Overrides superclass method. Adds checking * for object validity. In case this object is invalid * throws {@link java.io.NotSerializableException NotSerializableException}. * @throws ObjectStreamException When problem during serialization occures. * @throws NotSerializableException When this <code>CloneableEditor</code> * is invalid and doesn't want to be serialized. */ protected Object writeReplace() throws ObjectStreamException { if(discard()) { throw new NotSerializableException( "Serializing component is invalid: " + this); // NOI18N } return super.writeReplace(); }
/** * Replaces serializing object. Overrides superclass method. Adds checking * for object validity. In case this object is invalid * throws {@link java.io.NotSerializableException NotSerializableException}. * @throws ObjectStreamException When problem during serialization occures. * @throws NotSerializableException When this <code>CloneableEditor</code> * is invalid and doesn't want to be serialized. */ protected Object writeReplace() throws ObjectStreamException { if(discard()) { throw new NotSerializableException( "Serializing component is invalid: " + this); // NOI18N } return super.writeReplace(); }