mrglavas 2004/02/05 10:26:31 Modified: java/src/org/apache/xerces/dom PSVIElementNSImpl.java PSVIDocumentImpl.java PSVIAttrNSImpl.java Log: At the moment we do not support object serialization of grammars so a user cannot serialize a DOM containing PSVI. Adding readObject/writeObject methods which explicitly ban serialization of PSVI DOM. These must be removed once we support grammar serialization. Revision Changes Path 1.7 +18 -1 xml-xerces/java/src/org/apache/xerces/dom/PSVIElementNSImpl.java Index: PSVIElementNSImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/PSVIElementNSImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- PSVIElementNSImpl.java 4 Feb 2004 18:23:24 -0000 1.6 +++ PSVIElementNSImpl.java 5 Feb 2004 18:26:31 -0000 1.7 @@ -57,6 +57,11 @@ package org.apache.xerces.dom; +import java.io.IOException; +import java.io.NotSerializableException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + import org.apache.xerces.xs.ElementPSVI; import org.apache.xerces.xs.*; @@ -309,5 +314,17 @@ public ShortList getItemValueTypes() { return this.fItemValueTypes; } + + // REVISIT: Forbid serialization of PSVI DOM until + // we support object serialization of grammars -- mrglavas + + private void writeObject(ObjectOutputStream out) + throws IOException { + throw new NotSerializableException(getClass().getName()); + } + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + throw new NotSerializableException(getClass().getName()); + } } 1.7 +19 -1 xml-xerces/java/src/org/apache/xerces/dom/PSVIDocumentImpl.java Index: PSVIDocumentImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/PSVIDocumentImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- PSVIDocumentImpl.java 4 Feb 2004 18:23:24 -0000 1.6 +++ PSVIDocumentImpl.java 5 Feb 2004 18:26:31 -0000 1.7 @@ -57,6 +57,11 @@ package org.apache.xerces.dom; +import java.io.IOException; +import java.io.NotSerializableException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + // REVISIT: This is a HACK! DO NOT MODIFY THIS import. // It allows us to expose DOM L3 implemenation via org.w3c.dom packages import org.apache.xerces.dom3.DOMConfiguration; @@ -143,6 +148,19 @@ public DOMConfiguration getDomConfig(){ super.getDomConfig(); return fConfiguration; + } + + // REVISIT: Forbid serialization of PSVI DOM until + // we support object serialization of grammars -- mrglavas + + private void writeObject(ObjectOutputStream out) + throws IOException { + throw new NotSerializableException(getClass().getName()); + } + + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + throw new NotSerializableException(getClass().getName()); } } // class PSVIDocumentImpl 1.7 +18 -1 xml-xerces/java/src/org/apache/xerces/dom/PSVIAttrNSImpl.java Index: PSVIAttrNSImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/PSVIAttrNSImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- PSVIAttrNSImpl.java 4 Feb 2004 18:23:24 -0000 1.6 +++ PSVIAttrNSImpl.java 5 Feb 2004 18:26:31 -0000 1.7 @@ -57,6 +57,11 @@ package org.apache.xerces.dom; +import java.io.IOException; +import java.io.NotSerializableException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + import org.apache.xerces.xs.AttributePSVI; import org.apache.xerces.xs.*; @@ -268,5 +273,17 @@ public ShortList getItemValueTypes() { return this.fItemValueTypes; } + + // REVISIT: Forbid serialization of PSVI DOM until + // we support object serialization of grammars -- mrglavas + + private void writeObject(ObjectOutputStream out) + throws IOException { + throw new NotSerializableException(getClass().getName()); + } + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + throw new NotSerializableException(getClass().getName()); + } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]