/** * Gets the xmime:contentType value for the current object. * * @see JAXBContextImpl#getXMIMEContentType(Object) */ public String getXMIMEContentType() { /* this won't work when the class is like class Foo { @XmlValue Image img; } because the target will return Foo, not the class enclosing Foo which will have xmime:contentType */ Object t = current.target; if(t==null) return null; return getJAXBContext().getXMIMEContentType(t); }
@Override public Collection<QName> getExpectedChildElements() { return getInstance().getJAXBContext().getValidRootNames(); }
/** * On top of {@link JAXBContextImpl#selectRootLoader(State, TagName)}, * this method also consults {@link ClassResolver}. * * @throws SAXException * if {@link ValidationEventHandler} reported a failure. */ public Loader selectRootLoader(State state, TagName tag) throws SAXException { try { Loader l = getJAXBContext().selectRootLoader(state, tag); if(l!=null) return l; if(classResolver!=null) { Class<?> clazz = classResolver.resolveElementName(tag.uri, tag.local); if(clazz!=null) { JAXBContextImpl enhanced = getJAXBContext().createAugmented(clazz); JaxBeanInfo<?> bi = enhanced.getBeanInfo(clazz); return bi.getLoader(enhanced,true); } } } catch (RuntimeException e) { throw e; } catch (Exception e) { handleError(e); } return null; }
@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); }
return defaultLoader; beanInfo = context.getJAXBContext().getGlobalType(type); if (beanInfo == null) return defaultLoader; state.getContext().getJAXBContext(), cbii.getTransducer(), acc));
beanInfo = context.getJAXBContext().getGlobalType(type); if(beanInfo==null) { // let's report an error if (context.parent.hasEventHandler() // is somebody listening? String nearest = context.getJAXBContext().getNearestTypeName(type); if(nearest!=null) reportError(Messages.UNRECOGNIZED_TYPE_NAME_MAYBE.format(type,nearest),true);
/** * Gets the xmime:contentType value for the current object. * * @see JAXBContextImpl#getXMIMEContentType(Object) */ public String getXMIMEContentType() { /* this won't work when the class is like class Foo { @XmlValue Image img; } because the target will return Foo, not the class enclosing Foo which will have xmime:contentType */ Object t = current.target; if(t==null) return null; return getJAXBContext().getXMIMEContentType(t); }
@Override public Collection<QName> getExpectedChildElements() { return getInstance().getJAXBContext().getValidRootNames(); }
/** * On top of {@link JAXBContextImpl#selectRootLoader(State, TagName)}, * this method also consults {@link ClassResolver}. * * @throws SAXException * if {@link ValidationEventHandler} reported a failure. */ public Loader selectRootLoader(State state, TagName tag) throws SAXException { try { Loader l = getJAXBContext().selectRootLoader(state, tag); if(l!=null) return l; if(classResolver!=null) { Class<?> clazz = classResolver.resolveElementName(tag.uri, tag.local); if(clazz!=null) { JAXBContextImpl enhanced = getJAXBContext().createAugmented(clazz); JaxBeanInfo<?> bi = enhanced.getBeanInfo(clazz); return bi.getLoader(enhanced,true); } } } catch (RuntimeException e) { throw e; } catch (Exception e) { handleError(e); } return null; }
@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); }
return defaultLoader; beanInfo = context.getJAXBContext().getGlobalType(type); if (beanInfo == null) return defaultLoader; state.getContext().getJAXBContext(), cbii.getTransducer(), acc));
beanInfo = context.getJAXBContext().getGlobalType(type); if(beanInfo==null) { // let's report an error if (context.parent.hasEventHandler() // is somebody listening? String nearest = context.getJAXBContext().getNearestTypeName(type); if(nearest!=null) reportError(Messages.UNRECOGNIZED_TYPE_NAME_MAYBE.format(type,nearest),true);
/** * Gets the xmime:contentType value for the current object. * * @see JAXBContextImpl#getXMIMEContentType(Object) */ public String getXMIMEContentType() { /* this won't work when the class is like class Foo { @XmlValue Image img; } because the target will return Foo, not the class enclosing Foo which will have xmime:contentType */ Object t = current.target; if(t==null) return null; return getJAXBContext().getXMIMEContentType(t); }
/** * Gets the xmime:contentType value for the current object. * * @see JAXBContextImpl#getXMIMEContentType(Object) */ public String getXMIMEContentType() { /* this won't work when the class is like class Foo { @XmlValue Image img; } because the target will return Foo, not the class enclosing Foo which will have xmime:contentType */ Object t = current.target; if(t==null) return null; return getJAXBContext().getXMIMEContentType(t); }
@Override public Collection<QName> getExpectedChildElements() { return getInstance().getJAXBContext().getValidRootNames(); }
@Override public Collection<QName> getExpectedChildElements() { return getInstance().getJAXBContext().getValidRootNames(); }
/** * On top of {@link JAXBContextImpl#selectRootLoader(State, TagName)}, * this method also consults {@link ClassResolver}. * * @throws SAXException * if {@link ValidationEventHandler} reported a failure. */ public Loader selectRootLoader(State state, TagName tag) throws SAXException { try { Loader l = getJAXBContext().selectRootLoader(state, tag); if(l!=null) return l; if(classResolver!=null) { Class<?> clazz = classResolver.resolveElementName(tag.uri, tag.local); if(clazz!=null) { JAXBContextImpl enhanced = getJAXBContext().createAugmented(clazz); JaxBeanInfo<?> bi = enhanced.getBeanInfo(clazz); return bi.getLoader(enhanced,true); } } } catch (RuntimeException e) { throw e; } catch (Exception e) { handleError(e); } return null; }
/** * On top of {@link JAXBContextImpl#selectRootLoader(State, TagName)}, * this method also consults {@link ClassResolver}. * * @throws SAXException * if {@link ValidationEventHandler} reported a failure. */ public Loader selectRootLoader(State state, TagName tag) throws SAXException { try { Loader l = getJAXBContext().selectRootLoader(state, tag); if(l!=null) return l; if(classResolver!=null) { Class<?> clazz = classResolver.resolveElementName(tag.uri, tag.local); if(clazz!=null) { JAXBContextImpl enhanced = getJAXBContext().createAugmented(clazz); JaxBeanInfo<?> bi = enhanced.getBeanInfo(clazz); return bi.getLoader(enhanced,true); } } } catch (RuntimeException e) { throw e; } catch (Exception e) { handleError(e); } return null; }
@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); }
return defaultLoader; beanInfo = context.getJAXBContext().getGlobalType(type); if (beanInfo == null) return defaultLoader; state.getContext().getJAXBContext(), cbii.getTransducer(), acc));