public Object unmarshal(Object obj, IUnmarshallingContext ictx) throws JiBXException { // make sure we're at the appropriate start tag UnmarshallingContext ctx = (UnmarshallingContext)ictx; if (!ctx.isAt(m_uri, m_name)) { return null; } // get object reference for ID obj = ctx.attributeExistingIDREF(null, getAttributeName(), 0); // skip past the element ctx.parsePastEndTag(m_uri, m_name); return obj; } }
ctx.parsePastEndTag(m_uri, m_name);
ctx.parsePastEndTag(m_uri, m_name);
ctx.parsePastEndTag(null, ClassCustom.ELEMENT_NAME);
public Object unmarshal(Object obj, IUnmarshallingContext ictx) throws JiBXException { // make sure we're at the appropriate start tag UnmarshallingContext ctx = (UnmarshallingContext)ictx; if (!ctx.isAt(m_uri, m_name)) { ctx.throwStartTagNameError(m_uri, m_name); } // create new hashmap if needed int size = ctx.attributeInt(m_uri, getSizeAttributeName(), DEFAULT_SIZE); Map map = (Map)obj; if (map == null) { map = new HashMap(size); } // process all entries present in document ctx.parsePastStartTag(m_uri, m_name); while (ctx.isAt(m_uri, getEntryElementName())) { Object key = ctx.attributeText(m_uri, getKeyAttributeName(), null); ctx.parsePastStartTag(m_uri, getEntryElementName()); Object value = ctx.unmarshalElement(); map.put(key, value); ctx.parsePastEndTag(m_uri, getEntryElementName()); } ctx.parsePastEndTag(m_uri, m_name); return map; } }
ctx.parsePastEndTag(null, PackageCustom.ELEMENT_NAME); return inst;
ctx.parsePastEndTag(m_uri, m_name); return map;
public Object unmarshal(Object obj, IUnmarshallingContext ictx) throws JiBXException { // make sure we're at the appropriate start tag UnmarshallingContext ctx = (UnmarshallingContext)ictx; if (!ctx.isAt(m_uri, m_name)) { return null; } else { // check for reference to existing ID String id = ctx.attributeText(null, getAttributeName(), null); if (id == null) { // no ID value supplied, unmarshal full definition obj = ctx.unmarshalElement(); } else { // find object based on ID obj = ctx.findID(id, 0); ctx.parsePastEndTag(m_uri, m_name); if (obj == null) { ctx.throwStartTagException("Reference to undefined ID " + id); } } } return obj; } }