Examples of JAXBContextImpl


Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

                    throw new ServiceConstructionException(new Message("SCHEMA_GEN_EXC", BUNDLE), e);
                }
            }
           
            serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST, col);
            JAXBContextImpl riContext;
            if (context instanceof JAXBContextImpl) {
                riContext = (JAXBContextImpl) context;
            } else {
                // fall back if we're using another jaxb implementation
                try {
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

    */

    private static RuntimeTypeInfoSet create(Class... classes) throws Exception {
        IllegalAnnotationsException.Builder errorListener = new IllegalAnnotationsException.Builder();
        RuntimeInlineAnnotationReader reader = new RuntimeInlineAnnotationReader();
        JAXBContextImpl context =
            new JAXBContextImpl(classes, null, Collections.<Class, Class> emptyMap(), null, false, reader, false, false);
        RuntimeModelBuilder builder =
            new RuntimeModelBuilder(context, reader, Collections.<Class, Class> emptyMap(), null);
        builder.setErrorHandler(errorListener);
        for (Class c : classes)
            builder.getTypeInfo(new Ref<Type, Class>(c));
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

                                  col,
                                 (Document)r.getNode(),
                                  r.getSystemId());
            }

            JAXBContextImpl riContext;
            if (context instanceof JAXBContextImpl) {
                riContext = (JAXBContextImpl)context;
            } else {
                // fall back if we're using another jaxb implementation
                try {
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

        }
        if(jaxbNamespace == null) {
            jaxbNamespace = this.getSchemaTargetNameSpace();
        }

        JAXBContextImpl context = (JAXBContextImpl) createJAXBContext(classes, jaxbNamespace);

        for (DOMResult r : generateJaxbSchemas(context)) {
            Document d = (Document) r.getNode();
            String targetNamespace = d.getDocumentElement().getAttribute("targetNamespace");
            if ("".equals(targetNamespace)) {
                targetNamespace = this.getSchemaTargetNameSpace();
                d.getDocumentElement().setAttribute("targetNamespace", targetNamespace);
            }

            NodeList nodes = d.getDocumentElement().getChildNodes();
            for (int i = 0; i < nodes.getLength(); i++) {
                Node n = nodes.item(i);
                if (n instanceof Element) {
                    Element e = (Element) n;
                    if (e.getLocalName().equals("import")) {
                        d.getDocumentElement().removeChild(e);
                    }
                }
            }

            XmlSchema xmlSchema = xmlSchemaCollection.read(d.getDocumentElement());

            for (Class clazz : classes) {
                JaxBeanInfo<?> beanInfo = context.getBeanInfo(clazz);
                QName qName = getTypeName(beanInfo);
                if(qName != null) {
                    typeTable.addComplexSchema(clazz.getName(), qName);
                }
            }
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

            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;
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

            w.endElement();
        }
    }

    public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
        JAXBContextImpl context = chain.context;

        for (TypeRef<Type,Class> e : prop.getTypes()) {
            JaxBeanInfo bi = context.getOrCreate((RuntimeTypeInfo) e.getTarget());
            Loader l = bi.getLoader(context,true);
            if(e.getDefaultValue()!=null)
                l = new DefaultValueLoaderDecorator(l,e.getDefaultValue());
            if(nillable)
                l = new XsiNilLoader.Single(l,acc);
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

    /**
     * Used from the JAXB RI runtime API, invoked via reflection.
     */
    public static JAXBContext createContext( Class[] classes, Collection<TypeReference> typeRefs, String defaultNsUri, boolean c14nSupport ) throws JAXBException {
        return new JAXBContextImpl(classes,typeRefs,defaultNsUri,c14nSupport);
    }
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

        /**
         * Receives the root element and determines how to start
         * unmarshalling.
         */
        public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
            JAXBContextImpl jaxbContext = state.getContext().getJAXBContext();

            Loader loader = jaxbContext.selectRootLoader(state,ea);
            if(loader!=null) {
                state.loader = loader;
                state.receiver = this;
                return;
            }
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

            w.endElement();
        }
    }

    public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
        JAXBContextImpl context = chain.context;

        for (TypeRef<Type,Class> e : prop.getTypes()) {
            JaxBeanInfo bi = context.getOrCreate((RuntimeTypeInfo) e.getTarget());
            // if the expected Java type is already final, type substitution won't really work anyway.
            // this also traps cases like trying to substitute xsd:long element with xsi:type='xsd:int'
            Loader l = bi.getLoader(context,!Modifier.isFinal(bi.jaxbType.getModifiers()));
            if(e.getDefaultValue()!=null)
                l = new DefaultValueLoaderDecorator(l,e.getDefaultValue());
View Full Code Here

Examples of com.sun.xml.bind.v2.runtime.JAXBContextImpl

    public static JAXBRIContext createContext( Class[] classes,
            Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements,
            String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar,
            boolean xmlAccessorFactorySupport, boolean allNillable) throws JAXBException {
        return new JAXBContextImpl(classes,typeRefs,subclassReplacements,defaultNsUri,
                c14nSupport,ar, xmlAccessorFactorySupport,allNillable);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.