@Override public void leaveElement(UnmarshallingContext.State state, TagName ea) throws SAXException { state.getContext().endScope(frameSize); fireAfterUnmarshal(beanInfo, state.getTarget(), state.getPrev()); }
private SAXConnector getUnmarshallerHandler( boolean intern, JaxBeanInfo expectedType ) { XmlVisitor h = createUnmarshallerHandler(null, false, expectedType); if (intern) { h = new InterningXmlVisitor(h); } return new SAXConnector(h,null); }
@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 { UnmarshallingContext context = state.getContext(); context.startScope(1); // inherit the target so that our children can access its target state.setTarget(state.getPrev().getTarget()); // start it now, so that even if there's no children we can still return empty collection context.getScope(0).start(acc,lister); }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { Loader l = new LeafPropertyLoader(xacc); if (defaultValue != null) l = new DefaultValueLoaderDecorator(l, defaultValue); if (nillable || chain.context.allNillable) l = new XsiNilLoader.Single(l, acc); // LeafPropertyXsiLoader doesn't work well with nillable elements if (improvedXsiTypeHandling) l = new LeafPropertyXsiLoader(l, xacc, acc); handlers.put(tagName, new ChildLoader(l, null)); }
@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 { // 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); } }
private void processText( boolean ignorable ) throws SAXException { if( predictor.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer) || context.getCurrentState().isMixed())) { if(textReported) { textReported = false; } else { visitor.text(buffer); } } buffer.setLength(0); }
/** * Called when there's no corresponding ID value. */ public void errorUnresolvedIDREF(Object bean, String idref, LocatorEx loc) throws SAXException { handleEvent( new ValidationEventImpl( ValidationEvent.ERROR, Messages.UNRESOLVED_IDREF.format(idref), loc.getLocation()), true ); }
@Override public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException { if(ea.matches(entryTag)) { state.setLoader(entryLoader); } else { super.childElement(state,ea); } }
public void startElement(TagName tagName ) throws SAXException { attributes.setAttributes(tagName.atts); tagName.atts = attributes; tagName.uri = intern(tagName.uri); tagName.local = intern(tagName.local); next.startElement(tagName); }
@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { final Loader loader = selectLoader(state, ea); state.setLoader(loader); loader.startElement(state, ea); }
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) { Loader l = new LeafPropertyLoader(xacc); l = new DefaultValueLoaderDecorator(l, defaultValue); handlers.put(tagName, new ChildLoader(l,null)); }
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); }
protected Loader selectLoader(UnmarshallingContext.State state, TagName tag) throws SAXException { UnmarshallingContext context = state.getContext(); if(mode.allowTypedObject) { Loader l = context.selectRootLoader(state,tag); if(l!=null) return l; } if(mode.allowDom) return dom; // simply discard. return Discarder.INSTANCE; }
public void endElement(TagName tagName ) throws SAXException { tagName.uri = intern(tagName.uri); tagName.local = intern(tagName.local); next.endElement(tagName); }
/** * This method is called by the generated derived class * when a datatype parse method throws an exception. */ protected static void handleParseConversionException(UnmarshallingContext.State state, Exception e) throws SAXException { // wrap it into a ParseConversionEvent and report it state.getContext().handleError(e); } }
private void processUnreportedText() throws SAXException { if(!textReported && predictor.expectText()) { visitor.text(""); } textReported = false; } }
@Override public void leaveElement(UnmarshallingContext.State state, TagName ea) throws SAXException { state.getContext().endScope(1); }
@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); }