1 9 package org.ozoneDB.xml.util; 10 11 import java.io.*; 12 13 import org.w3c.dom.Node ; 14 15 import org.w3c.dom.traversal.NodeFilter; 16 import org.infozone.tools.xml.queries.XUpdateQuery; 17 18 19 24 public final class OzoneXUpdateQuery implements XUpdateQuery, Externalizable { 25 26 protected final static long serialVersionUID = 1L; 27 28 protected String qstring; 29 30 protected Node rootNode; 31 32 protected Node namespace; 33 34 protected NodeFilter filter; 35 36 protected transient XMLContainer delegate; 37 38 39 public OzoneXUpdateQuery() { 40 } 41 42 43 protected OzoneXUpdateQuery( XMLContainer _delegate ) { 44 delegate = _delegate; 45 } 46 47 48 public void setQString( String _qstring ) throws Exception { 49 qstring = _qstring; 50 } 51 52 53 public void setNamespace( Node _namespace ) throws Exception { 54 namespace = _namespace; 55 } 56 57 58 public void setNodeFilter( NodeFilter _filter ) throws Exception { 59 filter = _filter; 60 } 61 62 63 68 public void execute() throws Exception { 69 execute( null ); 70 } 71 72 73 79 public void execute( Node _rootNode ) throws Exception { 80 rootNode = _rootNode; 81 delegate.executeXUpdate( this ); 82 } 83 84 85 public void writeExternal( ObjectOutput out ) throws IOException { 86 out.writeObject( rootNode ); 87 out.writeObject( qstring ); 88 out.writeObject( namespace ); 89 out.writeObject( filter ); 90 } 91 92 93 public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { 94 rootNode = (Node )in.readObject(); 95 qstring = (String )in.readObject(); 96 namespace = (Node )in.readObject(); 97 filter = (NodeFilter)in.readObject(); 98 } 99 } 100 | Popular Tags |