com.sun.xml.internal.bind.v2.runtime.unmarshaller.ChildLoader Java Examples

The following examples show how to use com.sun.xml.internal.bind.v2.runtime.unmarshaller.ChildLoader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ArrayReferenceNodeProperty.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) {
    final int offset = chain.allocateOffset();

    Receiver recv = new ReceiverImpl(offset);

    for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) {
        final JaxBeanInfo beanInfo = n.getValue();
        loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv));
    }

    if(isMixed) {
        // handler for processing mixed contents.
        loaders.put(TEXT_HANDLER,
            new ChildLoader(new MixedTextLoader(recv),null));
    }

    if(domHandler!=null) {
        loaders.put(CATCH_ALL,
            new ChildLoader(new WildcardLoader(domHandler,wcMode),recv));
    }
}
 
Example #2
Source File: ArrayReferenceNodeProperty.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) {
    final int offset = chain.allocateOffset();

    Receiver recv = new ReceiverImpl(offset);

    for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) {
        final JaxBeanInfo beanInfo = n.getValue();
        loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv));
    }

    if(isMixed) {
        // handler for processing mixed contents.
        loaders.put(TEXT_HANDLER,
            new ChildLoader(new MixedTextLoader(recv),null));
    }

    if(domHandler!=null) {
        loaders.put(CATCH_ALL,
            new ChildLoader(new WildcardLoader(domHandler,wcMode),recv));
    }
}
 
Example #3
Source File: ArrayReferenceNodeProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) {
    final int offset = chain.allocateOffset();

    Receiver recv = new ReceiverImpl(offset);

    for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) {
        final JaxBeanInfo beanInfo = n.getValue();
        loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv));
    }

    if(isMixed) {
        // handler for processing mixed contents.
        loaders.put(TEXT_HANDLER,
            new ChildLoader(new MixedTextLoader(recv),null));
    }

    if(domHandler!=null) {
        loaders.put(CATCH_ALL,
            new ChildLoader(new WildcardLoader(domHandler,wcMode),recv));
    }
}
 
Example #4
Source File: ArrayReferenceNodeProperty.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) {
    final int offset = chain.allocateOffset();

    Receiver recv = new ReceiverImpl(offset);

    for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) {
        final JaxBeanInfo beanInfo = n.getValue();
        loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv));
    }

    if(isMixed) {
        // handler for processing mixed contents.
        loaders.put(TEXT_HANDLER,
            new ChildLoader(new MixedTextLoader(recv),null));
    }

    if(domHandler!=null) {
        loaders.put(CATCH_ALL,
            new ChildLoader(new WildcardLoader(domHandler,wcMode),recv));
    }
}
 
Example #5
Source File: ArrayReferenceNodeProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) {
    final int offset = chain.allocateOffset();

    Receiver recv = new ReceiverImpl(offset);

    for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) {
        final JaxBeanInfo beanInfo = n.getValue();
        loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv));
    }

    if(isMixed) {
        // handler for processing mixed contents.
        loaders.put(TEXT_HANDLER,
            new ChildLoader(new MixedTextLoader(recv),null));
    }

    if(domHandler!=null) {
        loaders.put(CATCH_ALL,
            new ChildLoader(new WildcardLoader(domHandler,wcMode),recv));
    }
}
 
Example #6
Source File: ArrayReferenceNodeProperty.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) {
    final int offset = chain.allocateOffset();

    Receiver recv = new ReceiverImpl(offset);

    for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) {
        final JaxBeanInfo beanInfo = n.getValue();
        loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv));
    }

    if(isMixed) {
        // handler for processing mixed contents.
        loaders.put(TEXT_HANDLER,
            new ChildLoader(new MixedTextLoader(recv),null));
    }

    if(domHandler!=null) {
        loaders.put(CATCH_ALL,
            new ChildLoader(new WildcardLoader(domHandler,wcMode),recv));
    }
}
 
Example #7
Source File: ArrayReferenceNodeProperty.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) {
    final int offset = chain.allocateOffset();

    Receiver recv = new ReceiverImpl(offset);

    for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) {
        final JaxBeanInfo beanInfo = n.getValue();
        loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv));
    }

    if(isMixed) {
        // handler for processing mixed contents.
        loaders.put(TEXT_HANDLER,
            new ChildLoader(new MixedTextLoader(recv),null));
    }

    if(domHandler!=null) {
        loaders.put(CATCH_ALL,
            new ChildLoader(new WildcardLoader(domHandler,wcMode),recv));
    }
}
 
Example #8
Source File: ArrayReferenceNodeProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void createBodyUnmarshaller(UnmarshallerChain chain, QNameMap<ChildLoader> loaders) {
    final int offset = chain.allocateOffset();

    Receiver recv = new ReceiverImpl(offset);

    for( QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet() ) {
        final JaxBeanInfo beanInfo = n.getValue();
        loaders.put(n.nsUri,n.localName,new ChildLoader(beanInfo.getLoader(chain.context,true),recv));
    }

    if(isMixed) {
        // handler for processing mixed contents.
        loaders.put(TEXT_HANDLER,
            new ChildLoader(new MixedTextLoader(recv),null));
    }

    if(domHandler!=null) {
        loaders.put(CATCH_ALL,
            new ChildLoader(new WildcardLoader(domHandler,wcMode),recv));
    }
}
 
Example #9
Source File: ArrayERProperty.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #10
Source File: SingleReferenceNodeProperty.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
    for (QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet())
        handlers.put(n.nsUri,n.localName, new ChildLoader(n.getValue().getLoader(chain.context,true),acc));

    if(domHandler!=null)
        handlers.put(CATCH_ALL,new ChildLoader(new WildcardLoader(domHandler,wcMode),acc));

}
 
Example #11
Source File: ElementBeanInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
    if(loader==null) {
        // this has to be done lazily to avoid cyclic reference issue
        UnmarshallerChain c = new UnmarshallerChain(context);
        QNameMap<ChildLoader> result = new QNameMap<ChildLoader>();
        property.buildChildElementUnmarshallers(c,result);
        if(result.size()==1)
            // for ElementBeanInfoImpl created from RuntimeElementInfo
            this.loader = new IntercepterLoader(result.getOne().getValue().loader);
        else
            // for special ElementBeanInfoImpl only used for marshalling
            this.loader = Discarder.INSTANCE;
    }
    return loader;
}
 
Example #12
Source File: ArrayERProperty.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #13
Source File: ElementBeanInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
    if(loader==null) {
        // this has to be done lazily to avoid cyclic reference issue
        UnmarshallerChain c = new UnmarshallerChain(context);
        QNameMap<ChildLoader> result = new QNameMap<ChildLoader>();
        property.buildChildElementUnmarshallers(c,result);
        if(result.size()==1)
            // for ElementBeanInfoImpl created from RuntimeElementInfo
            this.loader = new IntercepterLoader(result.getOne().getValue().loader);
        else
            // for special ElementBeanInfoImpl only used for marshalling
            this.loader = Discarder.INSTANCE;
    }
    return loader;
}
 
Example #14
Source File: ElementBeanInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
    if(loader==null) {
        // this has to be done lazily to avoid cyclic reference issue
        UnmarshallerChain c = new UnmarshallerChain(context);
        QNameMap<ChildLoader> result = new QNameMap<ChildLoader>();
        property.buildChildElementUnmarshallers(c,result);
        if(result.size()==1)
            // for ElementBeanInfoImpl created from RuntimeElementInfo
            this.loader = new IntercepterLoader(result.getOne().getValue().loader);
        else
            // for special ElementBeanInfoImpl only used for marshalling
            this.loader = Discarder.INSTANCE;
    }
    return loader;
}
 
Example #15
Source File: ElementBeanInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
    if(loader==null) {
        // this has to be done lazily to avoid cyclic reference issue
        UnmarshallerChain c = new UnmarshallerChain(context);
        QNameMap<ChildLoader> result = new QNameMap<ChildLoader>();
        property.buildChildElementUnmarshallers(c,result);
        if(result.size()==1)
            // for ElementBeanInfoImpl created from RuntimeElementInfo
            this.loader = new IntercepterLoader(result.getOne().getValue().loader);
        else
            // for special ElementBeanInfoImpl only used for marshalling
            this.loader = Discarder.INSTANCE;
    }
    return loader;
}
 
Example #16
Source File: SingleReferenceNodeProperty.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
    for (QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet())
        handlers.put(n.nsUri,n.localName, new ChildLoader(n.getValue().getLoader(chain.context,true),acc));

    if(domHandler!=null)
        handlers.put(CATCH_ALL,new ChildLoader(new WildcardLoader(domHandler,wcMode),acc));

}
 
Example #17
Source File: SingleReferenceNodeProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
    for (QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet())
        handlers.put(n.nsUri,n.localName, new ChildLoader(n.getValue().getLoader(chain.context,true),acc));

    if(domHandler!=null)
        handlers.put(CATCH_ALL,new ChildLoader(new WildcardLoader(domHandler,wcMode),acc));

}
 
Example #18
Source File: ArrayERProperty.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@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.loader = child.loader;
    state.receiver = child.receiver;
}
 
Example #19
Source File: SingleReferenceNodeProperty.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
    for (QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet())
        handlers.put(n.nsUri,n.localName, new ChildLoader(n.getValue().getLoader(chain.context,true),acc));

    if(domHandler!=null)
        handlers.put(CATCH_ALL,new ChildLoader(new WildcardLoader(domHandler,wcMode),acc));

}
 
Example #20
Source File: ElementBeanInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
    if(loader==null) {
        // this has to be done lazily to avoid cyclic reference issue
        UnmarshallerChain c = new UnmarshallerChain(context);
        QNameMap<ChildLoader> result = new QNameMap<ChildLoader>();
        property.buildChildElementUnmarshallers(c,result);
        if(result.size()==1)
            // for ElementBeanInfoImpl created from RuntimeElementInfo
            this.loader = new IntercepterLoader(result.getOne().getValue().loader);
        else
            // for special ElementBeanInfoImpl only used for marshalling
            this.loader = Discarder.INSTANCE;
    }
    return loader;
}
 
Example #21
Source File: ElementBeanInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
    if(loader==null) {
        // this has to be done lazily to avoid cyclic reference issue
        UnmarshallerChain c = new UnmarshallerChain(context);
        QNameMap<ChildLoader> result = new QNameMap<ChildLoader>();
        property.buildChildElementUnmarshallers(c,result);
        if(result.size()==1)
            // for ElementBeanInfoImpl created from RuntimeElementInfo
            this.loader = new IntercepterLoader(result.getOne().getValue().loader);
        else
            // for special ElementBeanInfoImpl only used for marshalling
            this.loader = Discarder.INSTANCE;
    }
    return loader;
}
 
Example #22
Source File: ArrayERProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #23
Source File: ElementBeanInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
    if(loader==null) {
        // this has to be done lazily to avoid cyclic reference issue
        UnmarshallerChain c = new UnmarshallerChain(context);
        QNameMap<ChildLoader> result = new QNameMap<ChildLoader>();
        property.buildChildElementUnmarshallers(c,result);
        if(result.size()==1)
            // for ElementBeanInfoImpl created from RuntimeElementInfo
            this.loader = new IntercepterLoader(result.getOne().getValue().loader);
        else
            // for special ElementBeanInfoImpl only used for marshalling
            this.loader = Discarder.INSTANCE;
    }
    return loader;
}
 
Example #24
Source File: SingleReferenceNodeProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
    for (QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet())
        handlers.put(n.nsUri,n.localName, new ChildLoader(n.getValue().getLoader(chain.context,true),acc));

    if(domHandler!=null)
        handlers.put(CATCH_ALL,new ChildLoader(new WildcardLoader(domHandler,wcMode),acc));

}
 
Example #25
Source File: ArrayERProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #26
Source File: ArrayERProperty.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #27
Source File: SingleReferenceNodeProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
    for (QNameMap.Entry<JaxBeanInfo> n : expectedElements.entrySet())
        handlers.put(n.nsUri,n.localName, new ChildLoader(n.getValue().getLoader(chain.context,true),acc));

    if(domHandler!=null)
        handlers.put(CATCH_ALL,new ChildLoader(new WildcardLoader(domHandler,wcMode),acc));

}
 
Example #28
Source File: ElementBeanInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
    if(loader==null) {
        // this has to be done lazily to avoid cyclic reference issue
        UnmarshallerChain c = new UnmarshallerChain(context);
        QNameMap<ChildLoader> result = new QNameMap<ChildLoader>();
        property.buildChildElementUnmarshallers(c,result);
        if(result.size()==1)
            // for ElementBeanInfoImpl created from RuntimeElementInfo
            this.loader = new IntercepterLoader(result.getOne().getValue().loader);
        else
            // for special ElementBeanInfoImpl only used for marshalling
            this.loader = Discarder.INSTANCE;
    }
    return loader;
}
 
Example #29
Source File: ElementBeanInfoImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * The constructor for the sole instanceof {@link JaxBeanInfo} for
 * handling user-created {@link JAXBElement}.
 *
 * Such {@link JaxBeanInfo} is used only for marshalling.
 *
 * This is a hack.
 */
protected ElementBeanInfoImpl(final JAXBContextImpl grammar) {
    super(grammar,null,JAXBElement.class,true,false,true);
    tagName = null;
    expectedType = null;
    scope = null;
    constructor = null;

    this.property = new Property<JAXBElement>() {
        public void reset(JAXBElement o) {
            throw new UnsupportedOperationException();
        }

        public void serializeBody(JAXBElement e, XMLSerializer target, Object outerPeer) throws SAXException, IOException, XMLStreamException {
            Class scope = e.getScope();
            if(e.isGlobalScope())   scope = null;
            QName n = e.getName();
            ElementBeanInfoImpl bi = grammar.getElement(scope,n);
            if(bi==null) {
                // infer what to do from the type
                JaxBeanInfo tbi;
                try {
                    tbi = grammar.getBeanInfo(e.getDeclaredType(),true);
                } catch (JAXBException x) {
                    // if e.getDeclaredType() isn't known to this JAXBContext
                    target.reportError(null,x);
                    return;
                }
                Object value = e.getValue();
                target.startElement(n.getNamespaceURI(),n.getLocalPart(),n.getPrefix(),null);
                if(value==null) {
                    target.writeXsiNilTrue();
                } else {
                    target.childAsXsiType(value,"value",tbi, false);
                }
                target.endElement();
            } else {
                try {
                    bi.property.serializeBody(e,target,e);
                } catch (AccessorException x) {
                    target.reportError(null,x);
                }
            }
        }

        public void serializeURIs(JAXBElement o, XMLSerializer target) {
        }

        public boolean hasSerializeURIAction() {
            return false;
        }

        public String getIdValue(JAXBElement o) {
            return null;
        }

        public PropertyKind getKind() {
            return PropertyKind.ELEMENT;
        }

        public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
        }

        public Accessor getElementPropertyAccessor(String nsUri, String localName) {
            throw new UnsupportedOperationException();
        }

        public void wrapUp() {
        }

        public RuntimePropertyInfo getInfo() {
            return property.getInfo();
        }

        public boolean isHiddenByOverride() {
            return false;
        }

        public void setHiddenByOverride(boolean hidden) {
            throw new UnsupportedOperationException("Not supported on jaxbelements.");
        }

        public String getFieldName() {
            return null;
        }

    };
}
 
Example #30
Source File: ArrayERProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public ItemsLoader(Accessor acc, Lister lister, QNameMap<ChildLoader> children) {
    super(false);
    this.acc = acc;
    this.lister = lister;
    this.children = children;
}