/** * Pushes a new object to the stack. * * @return * true if this object has already been pushed */ public boolean push(E o) { if(data.length==size) expandCapacity(); data[size] = o; int hash = hash(o); boolean r = findDuplicate(o, hash); next[size] = initialHash[hash]; initialHash[hash] = size+1; size++; this.latestPushResult = r; return latestPushResult; }
if(!cycleDetectionStack.push(obj)) return obj; cycleDetectionStack.pop(); return pushObject(obj,fieldName); } else Messages.CYCLE_IN_MARSHALLER.format(cycleDetectionStack.getCycleString()), getCurrentLocation(fieldName), null));
public boolean findDuplicate(E o) { int hash = hash(o); return findDuplicate(o, hash); }
public void childAsRoot(Object obj) throws JAXBException, IOException, SAXException, XMLStreamException { final JaxBeanInfo beanInfo = grammar.getBeanInfo(obj, true); // since the same object will be reported to childAsRoot or // childAsXsiType, don't make it a part of the collision check. // but we do need to push it so that getXMIMEContentType will work. cycleDetectionStack.pushNocheck(obj); final boolean lookForLifecycleMethods = beanInfo.lookForLifecycleMethods(); if (lookForLifecycleMethods) { fireBeforeMarshalEvents(beanInfo, obj); } beanInfo.serializeRoot(obj,this); if (lookForLifecycleMethods) { fireAfterMarshalEvents(beanInfo, obj); } cycleDetectionStack.pop(); }
public boolean handleError(Exception e) { return handleError(e,cycleDetectionStack.peek(),null); }
/** * Pushes a new object to the stack without making it participate * with the collision check. */ public void pushNocheck(E o) { if(data.length==size) expandCapacity(); data[size] = o; next[size] = -1; size++; }
public boolean getObjectIdentityCycleDetection() { return cycleDetectionStack.getUseIdentity(); }
/** * Pops an object from the stack */ public E pop() { size--; Object o = data[size]; data[size] = null; // keeping references too long == memory leak int n = next[size]; if(n<0) { // pushed by nocheck. no need to update hash } else { int hash = hash(o); assert initialHash[hash]==size+1; initialHash[hash] = n; } return (E)o; }
public boolean findDuplicate(E o) { int hash = hash(o); return findDuplicate(o, hash); }
public void childAsRoot(Object obj) throws JAXBException, IOException, SAXException, XMLStreamException { final JaxBeanInfo beanInfo = grammar.getBeanInfo(obj, true); // since the same object will be reported to childAsRoot or // childAsXsiType, don't make it a part of the collision check. // but we do need to push it so that getXMIMEContentType will work. cycleDetectionStack.pushNocheck(obj); final boolean lookForLifecycleMethods = beanInfo.lookForLifecycleMethods(); if (lookForLifecycleMethods) { fireBeforeMarshalEvents(beanInfo, obj); } beanInfo.serializeRoot(obj,this); if (lookForLifecycleMethods) { fireAfterMarshalEvents(beanInfo, obj); } cycleDetectionStack.pop(); }
public ValidationEventLocator getCurrentLocation(String fieldName) { return new ValidationEventLocatorExImpl(cycleDetectionStack.peek(),fieldName); }
cycleDetectionStack.pop();
/** * Pushes a new object to the stack without making it participate * with the collision check. */ public void pushNocheck(E o) { if(data.length==size) expandCapacity(); data[size] = o; next[size] = -1; size++; }
public boolean getObjectIdentityCycleDetection() { return cycleDetectionStack.getUseIdentity(); }
/** * Pops an object from the stack */ public E pop() { size--; Object o = data[size]; data[size] = null; // keeping references too long == memory leak int n = next[size]; if(n<0) { // pushed by nocheck. no need to update hash } else { int hash = hash(o); assert initialHash[hash]==size+1; initialHash[hash] = n; } return (E)o; }
/** * Pushes a new object to the stack. * * @return * true if this object has already been pushed */ public boolean push(E o) { if(data.length==size) expandCapacity(); data[size] = o; int hash = hash(o); boolean r = findDuplicate(o, hash); next[size] = initialHash[hash]; initialHash[hash] = size+1; size++; this.latestPushResult = r; return latestPushResult; }
if(!cycleDetectionStack.push(obj)) return obj; cycleDetectionStack.pop(); return pushObject(obj,fieldName); } else Messages.CYCLE_IN_MARSHALLER.format(cycleDetectionStack.getCycleString()), getCurrentLocation(fieldName), null));
public boolean findDuplicate(E o) { int hash = hash(o); return findDuplicate(o, hash); }