/** * Finishes up the current packing in progress (if any) and * resets this object. */ public void finish() throws AccessorException { if(hasStarted()) { lister.endPacking(pack,bean,acc); reset(); } assert clean(); }
/** * Starts the packing scope, without adding any item. * * This allows us to return an empty pack, thereby allowing the user * to distinguish empty array vs null array. */ public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{ try { if(!hasStarted()) { this.bean = (BeanT)context.getCurrentState().getTarget(); this.acc = acc; this.lister = lister; this.pack = lister.startPacking(bean,acc); } } catch (AccessorException e) { Loader.handleGenericException(e,true); // recover from this error by ignoring future items. this.lister = Lister.getErrorInstance(); this.acc = Accessor.getErrorInstance(); } } }
/** * Adds a new item to this packing scope. */ public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{ try { if(!hasStarted()) { this.bean = (BeanT)context.getCurrentState().getTarget(); this.acc = acc; this.lister = lister; this.pack = lister.startPacking(bean,acc); } lister.addToPack(pack,value); } catch (AccessorException e) { Loader.handleGenericException(e,true); // recover from this error by ignoring future items. this.lister = Lister.getErrorInstance(); this.acc = Accessor.getErrorInstance(); } }
/** * Finishes up the current packing in progress (if any) and * resets this object. */ public void finish() throws AccessorException { if(hasStarted()) { lister.endPacking(pack,bean,acc); reset(); } assert clean(); }
/** * Starts the packing scope, without adding any item. * * This allows us to return an empty pack, thereby allowing the user * to distinguish empty array vs null array. */ public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{ try { if(!hasStarted()) { this.bean = (BeanT)context.getCurrentState().getTarget(); this.acc = acc; this.lister = lister; this.pack = lister.startPacking(bean,acc); } } catch (AccessorException e) { Loader.handleGenericException(e,true); // recover from this error by ignoring future items. this.lister = Lister.getErrorInstance(); this.acc = Accessor.getErrorInstance(); } } }
/** * Adds a new item to this packing scope. */ public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{ try { if(!hasStarted()) { this.bean = (BeanT)context.getCurrentState().getTarget(); this.acc = acc; this.lister = lister; this.pack = lister.startPacking(bean,acc); } lister.addToPack(pack,value); } catch (AccessorException e) { Loader.handleGenericException(e,true); // recover from this error by ignoring future items. this.lister = Lister.getErrorInstance(); this.acc = Accessor.getErrorInstance(); } }
/** * Finishes up the current packing in progress (if any) and * resets this object. */ public void finish() throws AccessorException { if(hasStarted()) { lister.endPacking(pack,bean,acc); reset(); } assert clean(); }
/** * Finishes up the current packing in progress (if any) and * resets this object. */ public void finish() throws AccessorException { if(hasStarted()) { lister.endPacking(pack,bean,acc); reset(); } assert clean(); }
/** * Starts the packing scope, without adding any item. * * This allows us to return an empty pack, thereby allowing the user * to distinguish empty array vs null array. */ public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{ try { if(!hasStarted()) { this.bean = (BeanT)context.getCurrentState().getTarget(); this.acc = acc; this.lister = lister; this.pack = lister.startPacking(bean,acc); } } catch (AccessorException e) { Loader.handleGenericException(e,true); // recover from this error by ignoring future items. this.lister = Lister.getErrorInstance(); this.acc = Accessor.getErrorInstance(); } } }
/** * Starts the packing scope, without adding any item. * * This allows us to return an empty pack, thereby allowing the user * to distinguish empty array vs null array. */ public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{ try { if(!hasStarted()) { this.bean = (BeanT)context.getCurrentState().getTarget(); this.acc = acc; this.lister = lister; this.pack = lister.startPacking(bean,acc); } } catch (AccessorException e) { Loader.handleGenericException(e,true); // recover from this error by ignoring future items. this.lister = Lister.getErrorInstance(); this.acc = Accessor.getErrorInstance(); } } }
/** * Adds a new item to this packing scope. */ public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{ try { if(!hasStarted()) { this.bean = (BeanT)context.getCurrentState().getTarget(); this.acc = acc; this.lister = lister; this.pack = lister.startPacking(bean,acc); } lister.addToPack(pack,value); } catch (AccessorException e) { Loader.handleGenericException(e,true); // recover from this error by ignoring future items. this.lister = Lister.getErrorInstance(); this.acc = Accessor.getErrorInstance(); } }
/** * Adds a new item to this packing scope. */ public void add( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister, ItemT value) throws SAXException{ try { if(!hasStarted()) { this.bean = (BeanT)context.getCurrentState().getTarget(); this.acc = acc; this.lister = lister; this.pack = lister.startPacking(bean,acc); } lister.addToPack(pack,value); } catch (AccessorException e) { Loader.handleGenericException(e,true); // recover from this error by ignoring future items. this.lister = Lister.getErrorInstance(); this.acc = Accessor.getErrorInstance(); } }