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

Examples of com.sun.xml.bind.v2.model.nav.ReflectionNavigator$BinderArg


        // register primitives for boxed types just to make GrammarInfo fool-proof
        for( Map.Entry<Class,Class> e : RuntimeUtil.primitiveToBox.entrySet() )
            beanInfoMap.put( e.getKey(), beanInfoMap.get(e.getValue()) );

        // build bridges
        ReflectionNavigator nav = typeSet.getNavigator();

        for (TypeReference tr : typeRefs) {
            XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class);
            Adapter<Type,Class> a=null;
            XmlList xl = tr.get(XmlList.class);

            // eventually compute the in-memory type
            Class erasedType = nav.erasure(tr.type);

            if(xjta!=null) {
                a = new Adapter<Type,Class>(xjta.value(),nav);
            }
            if(tr.get(XmlAttachmentRef.class)!=null) {
                a = new Adapter<Type,Class>(SwaRefAdapter.class,nav);
                hasSwaRef = true;
            }

            if(a!=null) {
                erasedType = nav.erasure(a.defaultType);
            }

            Name name = nameBuilder.createElementName(tr.tagName);

            InternalBridge bridge;
View Full Code Here


/*     */
/* 352 */     for (Map.Entry e : RuntimeUtil.primitiveToBox.entrySet()) {
/* 353 */       this.beanInfoMap.put(e.getKey(), this.beanInfoMap.get(e.getValue()));
/*     */     }
/*     */
/* 356 */     ReflectionNavigator nav = typeSet.getNavigator();
/*     */
/* 358 */     for (TypeReference tr : typeRefs) {
/* 359 */       XmlJavaTypeAdapter xjta = (XmlJavaTypeAdapter)tr.get(XmlJavaTypeAdapter.class);
/* 360 */       Adapter a = null;
/* 361 */       XmlList xl = (XmlList)tr.get(XmlList.class);
/*     */
/* 364 */       Class erasedType = nav.erasure(tr.type);
/*     */
/* 366 */       if (xjta != null) {
/* 367 */         a = new Adapter(xjta.value(), nav);
/*     */       }
/* 369 */       if (tr.get(XmlAttachmentRef.class) != null) {
/* 370 */         a = new Adapter(SwaRefAdapter.class, nav);
/* 371 */         this.hasSwaRef = true;
/*     */       }
/*     */
/* 374 */       if (a != null) {
/* 375 */         erasedType = nav.erasure((Type)a.defaultType);
/*     */       }
/*     */
/* 378 */       Name name = this.nameBuilder.createElementName(tr.tagName);
/*     */       InternalBridge bridge;
/*     */       InternalBridge bridge;
View Full Code Here

        // register primitives for boxed types just to make GrammarInfo fool-proof
        for( Map.Entry<Class,Class> e : RuntimeUtil.primitiveToBox.entrySet() )
            beanInfoMap.put( e.getKey(), beanInfoMap.get(e.getValue()) );

        // build bridges
        ReflectionNavigator nav = typeSet.getNavigator();

        for (TypeReference tr : typeRefs) {
            XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class);
            Adapter<Type,Class> a=null;
            XmlList xl = tr.get(XmlList.class);

            // eventually compute the in-memory type
            Class erasedType = nav.erasure(tr.type);

            if(xjta!=null) {
                a = new Adapter<Type,Class>(xjta.value(),nav);
            }
            if(tr.get(XmlAttachmentRef.class)!=null) {
                a = new Adapter<Type,Class>(SwaRefAdapter.class,nav);
                hasSwaRef = true;
            }

            if(a!=null) {
                erasedType = nav.erasure(a.defaultType);
            }

            Name name = nameBuilder.createElementName(tr.tagName);

            InternalBridge bridge;
View Full Code Here

            return Collections.emptyMap();
        }
        Map<String, Accessor> map = new HashMap<String, Accessor>();
        Class<?> type = target.getClass();
        RuntimeTypeInfoSet set = create(type);
        RuntimeClassInfo clsInfo = (RuntimeClassInfo)set.getTypeInfo(type);
        for (RuntimePropertyInfo f : clsInfo.getProperties()) {
            map.put(f.getName(), new JAXBAccessor(target, f));
        }
        return map;
    }
View Full Code Here

    }

    public void testReflection() throws Exception {
        MyBean bean = new MyBean();
        RuntimeTypeInfoSet model = create(MyBean.class);
        RuntimeClassInfo clsInfo = (RuntimeClassInfo)model.getTypeInfo(MyBean.class);
        for (RuntimePropertyInfo p : clsInfo.getProperties()) {
            // System.out.print(p.getName());
            // System.out.println(" " + p.isCollection());
            if (p.getName().equals("notes")) {
                Collection c = (Collection)p.getAccessor().get(bean);
                c.add("123");
View Full Code Here

    }

    public void testReflection() throws Exception {
        MyBean bean = new MyBean();
        RuntimeTypeInfoSet model = create(MyBean.class);
        RuntimeClassInfo clsInfo = (RuntimeClassInfo)model.getTypeInfo(MyBean.class);
        for (RuntimePropertyInfo p : clsInfo.getProperties()) {
            // System.out.print(p.getName());
            // System.out.println(" " + p.isCollection());
            if (p.getName().equals("notes")) {
                Collection c = (Collection)p.getAccessor().get(bean);
                c.add("123");
View Full Code Here

    }

    public void testReflection() throws Exception {
        MyBean bean = new MyBean();
        RuntimeTypeInfoSet model = create(MyBean.class);
        RuntimeClassInfo clsInfo = (RuntimeClassInfo)model.getTypeInfo(MyBean.class);
        for (RuntimePropertyInfo p : clsInfo.getProperties()) {
            // System.out.print(p.getName());
            // System.out.println(" " + p.isCollection());
            if (p.getName().equals("notes")) {
                Collection c = (Collection)p.getAccessor().get(bean);
                c.add("123");
View Full Code Here

        for( RuntimeElementInfo n : typeSet.getAllElements() ) {
            ElementBeanInfoImpl bi = getOrCreate(n);
            if(n.getScope()==null)
                rootMap.put(n.getElementName(),bi);

            RuntimeClassInfo scope = n.getScope();
            Class scopeClazz = scope==null?null:scope.getClazz();
            Map<QName,ElementBeanInfoImpl> m = elements.get(scopeClazz);
            if(m==null) {
                m = new LinkedHashMap<QName, ElementBeanInfoImpl>();
                elements.put(scopeClazz,m);
            }
View Full Code Here

    }

    public void testReflection() throws Exception {
        MyBean bean = new MyBean();
        RuntimeTypeInfoSet model = create(MyBean.class);
        RuntimeClassInfo clsInfo = (RuntimeClassInfo)model.getTypeInfo(MyBean.class);
        for (RuntimePropertyInfo p : clsInfo.getProperties()) {
            // System.out.print(p.getName());
            // System.out.println(" " + p.isCollection());
            if (p.getName().equals("notes")) {
                Collection c = (Collection)p.getAccessor().get(bean);
                c.add("123");
View Full Code Here

        return (cp == null) ? null : cp.getInfo();
    }

    @Override
    public boolean isArrayCollection() {
        RuntimePropertyInfo runtimePropertyInfo = isReader ? null : getCurrentElementRuntimePropertyInfo();

        if (runtimePropertyInfo == null && !processedNodes.isEmpty()) {
            final NodeWrapper peek = processedNodes.getLast();
            runtimePropertyInfo = peek.runtimePropertyInfo;
        }

        return runtimePropertyInfo != null && runtimePropertyInfo.isCollection() && !isWildcardElement(runtimePropertyInfo);
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.model.nav.ReflectionNavigator$BinderArg

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.