Package com.sun.xml.bind.v2.model.runtime

Examples of com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo


            JVar var = builder.as(String.class, nillable);
            toSet = JExpr._new(bdType).arg(var);
        } else if (c.equals(QName.class)) {
            toSet = builder.getXSR().invoke("getElementAsQName");
        } else if (target instanceof RuntimeClassInfo) {
            RuntimeClassInfo rci = (RuntimeClassInfo) target;
            JType type = builder.getCodeModel()._ref(c);
           
            JVar var = builder.getBody().decl(type, type.name(), JExpr._new(type));
           
            handleProperties(rci, c, builder, var);
View Full Code Here


            toSet = JExpr._new(bdType).arg(var);
        } else if (c.equals(QName.class)) {
            JVar var = builder.as(String.class);
            toSet = builder.getXSR().invoke("getAsQName").arg(var);
        } else if (target instanceof RuntimeClassInfo) {
            RuntimeClassInfo rci = (RuntimeClassInfo) target;
            rci.getProperties();
            System.err.println("Could not map attribute " + c);
            return JExpr._null();
        } else {
           
            System.err.println("Could not map attribute " + c);
View Full Code Here

        Map<Class, ? extends RuntimeClassInfo> beans = set.beans();
        for (Class cls : classes) {
            JType jt = getType(cls);
            ElementWriterBuilder instcWriter = rootWriter.newCondition(rootWriter.getObject()._instanceof(jt), jt);
            RuntimeClassInfo rci = beans.get(cls);
            add(instcWriter, cls, rci);
            instcWriter.getCurrentBlock()._return();
           
            if (!beans.get(cls).isElement()) {
                c2type.put(cls, rci.getTypeName());
            }
        }

        Map<QName, ? extends RuntimeElementInfo> elementMappings = set.getElementMappings(null);
        for (Map.Entry<QName, ? extends RuntimeElementInfo> e : elementMappings.entrySet()) {
View Full Code Here

                                   target,
                                   propEl.getAdapter(),
                                   typeRef.isNillable(),
                                   rawType, c, jt);
        } else if (target instanceof RuntimeClassInfo) {
            RuntimeClassInfo rci = (RuntimeClassInfo)target;

            List<Class<?>> substTypes = getSubstitutionTypes(c);
            JBlock origBlck = valueBuilder.getCurrentBlock();
           
            if (typeRef.isNillable()) {
View Full Code Here

        BuilderKey key = new BuilderKey();
        key.parentClass = parentClass;
        key.typeClass = subCls;
       
        if (!type2Writer.containsKey(key)) {
            RuntimeClassInfo substRCI = set.beans().get(subCls);
            type2Writer.put(key, b2);
            add(b2, name, subCls, substRCI, false, subCls != rci.getClazz());
        } else {
            WriterBuilder builder2 = type2Writer.get(key);
           
View Full Code Here

           
            // Handle all the possible child types
            Map<Class, ? extends RuntimeClassInfo> beans = set.beans();
            for (Map.Entry<Class, ? extends RuntimeClassInfo> e : beans.entrySet()) {
                Class c = e.getKey();
                RuntimeClassInfo clsInfo = e.getValue();
               
                if (propCls.isAssignableFrom(c)
                    && propCls != c
                    && !Modifier.isAbstract(c.getModifiers())) {
                    ElementParserBuilder xsiBuilder = propBuilder.expectXsiType(clsInfo.getTypeName());
                    JVar xsiVar = xsiBuilder.passParentVariable(propVar);
                    handlePropertyElement(xsiBuilder, xsiVar, beanClass,
                                          propEl,
                                          typeRef.getTagName(),
                                          typeRef.isNillable(),
View Full Code Here

            JExpression toSet = handleElement(builder, target, adapter, c, nillable);

            if (toSet != null)
                doSet(block, bean, beanClass, propEl, toSet);
        } else if (target instanceof RuntimeClassInfo) {
            RuntimeClassInfo rci = (RuntimeClassInfo) target;
           
            BuilderKey key = new BuilderKey();
            key.parentClass = beanClass;
            key.type = name;
           
View Full Code Here

            JVar var = builder.as(String.class, nillable);
            toSet = JExpr._new(bdType).arg(var);
        } else if (c.equals(QName.class)) {
            toSet = builder.getXSR().invoke("getElementAsQName");
        } else if (target instanceof RuntimeClassInfo) {
            RuntimeClassInfo rci = (RuntimeClassInfo) target;
            JType type = builder.getCodeModel()._ref(c);
           
            JVar var = builder.getBody().decl(type, type.name(), JExpr._new(type));
           
            handleProperties(rci, c, builder, var);
View Full Code Here

            toSet = JExpr._new(bdType).arg(var);
        } else if (c.equals(QName.class)) {
            JVar var = builder.as(String.class);
            toSet = builder.getXSR().invoke("getAsQName").arg(var);
        } else if (target instanceof RuntimeClassInfo) {
            RuntimeClassInfo rci = (RuntimeClassInfo) target;
            rci.getProperties();
            System.err.println("Could not map attribute " + c);
            return JExpr._null();
        } else {
           
            System.err.println("Could not map attribute " + c);
View Full Code Here

            bean.addProperty(anyAttributeProperty);
        }


        Bean baseClass = null;
        RuntimeClassInfo baseClassInfo = runtimeClassInfo.getBaseClass();
        if (baseClassInfo != null) {
            baseClass = model.getBean(baseClassInfo.getClazz());
            if (baseClass == null) {
                baseClass = addBean(model, baseClassInfo);
            }
        }
        bean.setBaseClass(baseClass);
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo

Copyright © 2018 www.massapicom. 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.