private final Vector obj;
private final Hashtable oldobjhashes;
private final Hashtable objrefs;
- private final Vector updatedobjs;
-
- public VorbaXmlBinder(IVorbaIdFactory vorbafactory, Vector obj, Hashtable objrefs, Hashtable oldobjhashes, Vector updatedobjs) {
- this.vorbafactory = vorbafactory;
- this.obj = obj;
- this.objrefs = objrefs;
+ private final Vector updatedobjs; // not yet used elswhere ?
+ public VorbaXmlBinder(IVorbaIdFactory vorbafactory2, Vector unrefedObj, Hashtable objrefs2, Hashtable oldobjhashes, Vector updatedObj) {
+ this.vorbafactory = vorbafactory2;
+ this.obj = unrefedObj;
+ this.objrefs = objrefs2;
this.oldobjhashes = oldobjhashes;
- this.updatedobjs = updatedobjs;
+ this.updatedobjs = updatedObj;
}
/*
* @see org.exolab.castor.xml.UnmarshalListener#attributesProcessed(java.lang.Object)
*/
public void attributesProcessed(Object object) {
+
}
/*
* @see org.exolab.castor.xml.UnmarshalListener#initialized(java.lang.Object)
*/
public void initialized(Object object) {
+ if (object instanceof Vobject) {
+ Vobject nobj = (Vobject) object;
+ }
}
/*
// TODO: add to list of objects without a valid vorbaId
obj.add(nobj);
}
- nobj.doHash();
+ nobj.doHash(); // updates detected by comparing with last hash when marshalling
// check to see if new object was present in old object hash
if (nobj_id!=null) {
if (oldobjhashes.containsKey(nobj_id)) {
if (oldhash.isUpdated(nobj)) {
// mark the object as updated in this document read.
nobj.set__updated_since_last_read(true);
- oldobjhashes.put(nobj_id, new Vobjhash(nobj));
updatedobjs.addElement(nobj);
}
} else {
// object has no entry in the oldhashvalue list but
// there is a valid vorbaId so
nobj.set__added_since_last_read(true);
-
}
// and record the just-unmarshalled hash value
oldobjhashes.put(nobj_id, new Vobjhash(nobj));
if (doc.__vorba==null)
doc.__vorba = vorba;
doc.__ensure_instance_ids(); // this may take a while. Do we allow for cyclic references ?
- doc.marshal(outstream);
+ Marshaller mshl = new Marshaller(outstream);
+ mshl.marshal(doc);
}
/**
Unmarshaller unmarshaller = new Unmarshaller(root);
unmarshaller.setIDResolver(new IDResolver() {
public Object resolve(String id) {
+ // TODO: allow for external ID resolution
VorbaXmlBinder.log.warn("Warning - id " + id
- + " is not found in the Vamsas XML!");
+ + " is not found in the Vamsas XML! (TODO: Ignore if this is a forward reference!)");
return null;
}
});
final VorbaIdFactory vorbafactory = factory;
final Vector unrefedObj = new Vector();
final Vector updatedObj = new Vector();
- unmarshaller.setUnmarshalListener(new VorbaXmlBinder(vorbafactory, unrefedObj, objrefs, oobjhashes, updatedObj));
+ unmarshaller.setUnmarshalListener(new VorbaXmlBinder(vorbafactory, unrefedObj, objrefs, oobjhashes,updatedObj));
// Call the unmarshaller.
try {
while (instream.ready()) {