@Override public void childElement(UnmarshallingContext.State state, TagName arg) throws SAXException { ChildLoader child = childUnmarshallers.get(arg.uri,arg.local); if(child == null) { Boolean backupWithParentNamespace = ((JAXBContextImpl) state.getContext().getJAXBContext()).backupWithParentNamespace; backupWithParentNamespace = backupWithParentNamespace != null ? backupWithParentNamespace : Boolean.parseBoolean(Util.getSystemProperty(JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE)); if ((beanInfo != null) && (beanInfo.getTypeNames() != null) && backupWithParentNamespace) { Iterator<?> typeNamesIt = beanInfo.getTypeNames().iterator(); QName parentQName = null; if ((typeNamesIt != null) && (typeNamesIt.hasNext()) && (catchAll == null)) { parentQName = (QName) typeNamesIt.next(); String parentUri = parentQName.getNamespaceURI(); child = childUnmarshallers.get(parentUri, arg.local); } } if (child == null) { child = catchAll; if(child==null) { super.childElement(state,arg); return; } } } state.setLoader(child.loader); state.setReceiver(child.receiver); }
@Override public final void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { state.setLoader(core); state.setIntercepter(this); // TODO: make sure there aren't too many duplicate of this code // create the object to unmarshal Object child; UnmarshallingContext context = state.getContext(); // let's see if we can reuse the existing peer object child = context.getOuterPeer(); if(child!=null && jaxbType!=child.getClass()) child = null; // unexpected type. if(child!=null) reset((JAXBElement)child,context); if(child==null) child = context.createInstance(ElementBeanInfoImpl.this); fireBeforeUnmarshal(ElementBeanInfoImpl.this, child, state); context.recordOuterPeer(child); UnmarshallingContext.State p = state.getPrev(); p.setBackup(p.getTarget()); p.setTarget(child); core.startElement(state,ea); }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) { state.setTarget(null); // registering this allows the discarder to process the whole subtree. state.setLoader(this); } }
@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { final Loader loader = selectLoader(state, ea); state.setLoader(loader); loader.startElement(state, ea); }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { if(ea.matches(entryTag)) { state.setLoader(entryLoader); } else { super.childElement(state,ea); } }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { state.setLoader(this); State s = (State) state.getPrev().getTarget(); s.depth++; state.setTarget(s); }
@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { // install the default value, but don't override the one given by the parent loader if(state.getElementDefaultValue() == null) state.setElementDefaultValue(defaultValue); state.setLoader(l); l.startElement(state,ea); } }
@Override public final void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { Loader loader = selectLoader(state,ea); state.setLoader(loader); loader.startElement(state,ea); }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { if(ea.matches("","item")) { state.setLoader(itemLoader); state.setReceiver(this); } else { super.childElement(state,ea); } }
/** * Called when this loaderis an active loaderand we see a new child start tag. * * <p> * The callee is expected to designate another loaderas a loaderthat processes * this element, then it should also register a {@link Receiver}. * The designated loaderwill become an active loader. * * <p> * The default implementation reports an error saying an element is unexpected. */ public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { // notify the error, then recover by ignoring the whole element. reportUnexpectedChildElement(ea, true); state.setLoader(Discarder.INSTANCE); state.setReceiver(null); }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { if(ea.matches(keyTag)) { state.setLoader(keyLoader); state.setReceiver(keyReceiver); return; } if(ea.matches(valueTag)) { state.setLoader(valueLoader); state.setReceiver(valueReceiver); return; } super.childElement(state,ea); }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { if(ea.matches(entryTag)) { state.setLoader(entryLoader); } else { super.childElement(state,ea); } }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { ChildLoader child = children.get(ea.uri,ea.local); if (child == null) { child = children.get(CATCH_ALL); } if (child == null) { super.childElement(state,ea); return; } state.setLoader(child.loader); state.setReceiver(child.receiver); }
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { JaxBeanInfo beanInfo = parseXsiType(state,ea,defaultBeanInfo); if(beanInfo==null) beanInfo = defaultBeanInfo; Loader loader = beanInfo.getLoader(null,false); state.setLoader(loader); loader.startElement(state,ea); }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { if(ea.matches("","item")) { state.setLoader(itemLoader); state.setReceiver(this); } else { super.childElement(state,ea); } }
@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { final Loader loader = selectLoader(state, ea); state.setLoader(loader); loader.startElement(state, ea); }
@Override public final void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { Loader loader = selectLoader(state,ea); state.setLoader(loader); loader.startElement(state,ea); }
@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { // install the default value, but don't override the one given by the parent loader if(state.getElementDefaultValue() == null) state.setElementDefaultValue(defaultValue); state.setLoader(l); l.startElement(state,ea); } }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { state.setLoader(this); State s = (State) state.getPrev().getTarget(); s.depth++; state.setTarget(s); }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) { state.setTarget(null); // registering this allows the discarder to process the whole subtree. state.setLoader(this); } }