1 28 29 package org.jibx.extras; 30 31 import org.jibx.runtime.IMarshaller; 32 import org.jibx.runtime.IMarshallingContext; 33 import org.jibx.runtime.IUnmarshaller; 34 import org.jibx.runtime.IUnmarshallingContext; 35 import org.jibx.runtime.JiBXException; 36 import org.jibx.runtime.impl.UnmarshallingContext; 37 38 46 47 public class DiscardListMapper implements IMarshaller, IUnmarshaller 48 { 49 52 53 public boolean isExtension(int index) { 54 return false; 55 } 56 57 61 62 public void marshal(Object obj, IMarshallingContext ictx) {} 63 64 67 68 public boolean isPresent(IUnmarshallingContext ctx) throws JiBXException { 69 return !ctx.isEnd(); 70 } 71 72 76 77 public Object unmarshal(Object obj, IUnmarshallingContext ictx) 78 throws JiBXException { 79 80 while (!ictx.isEnd()) { 82 ((UnmarshallingContext)ictx).skipElement(); 83 } 84 return null; 85 } 86 } | Popular Tags |