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

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


     * Shouldn't be called from anywhere else.
     *
     * TODO: this is not the proper place for this class to be in.
     */
    public static Transducer createTransducer(RuntimeNonElementRef ref) {
        Transducer t = ref.getTarget().getTransducer();
        RuntimePropertyInfo src = ref.getSource();
        ID id = src.id();

        if(id==ID.IDREF)
            return RuntimeBuiltinLeafInfoImpl.STRING;
View Full Code Here


     *
     * <p>
     * This allows the implementation to use an optimized code.
     */
    public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
        Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
        RuntimePropertyInfo prop = ref.getSource();

        if(prop.isCollection()) {
            return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
                    Lister.create(Navigator.REFLECTION.erasure(prop.getRawType()),prop.id(),
                    prop.getAdapter()));
        }

        if(prop.id()==ID.IDREF)
            return new IDREFTransducedAccessorImpl(prop.getAccessor());

        if(xducer.isDefault() && context != null && !context.fastBoot) {
            TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
            if(xa!=null)    return xa;
        }

        if(xducer.useNamespace())
            return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
        else
            return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
    }
View Full Code Here

        RuntimeTypeRef ref = prop.getTypes().get(0);

        tagName = grammar.nameBuilder.createElementName(ref.getTagName());

        // transducer for each item
        Transducer xducer = ref.getTransducer();
        // transduced accessor for the whole thing
        xacc = new ListTransducedAccessorImpl(xducer,acc,lister);
    }
View Full Code Here

     * @param chain
     * @param typeRef
     */
    private Loader createItemUnmarshaller(UnmarshallerChain chain, RuntimeTypeRef typeRef) {
        if(PropertyFactory.isLeaf(typeRef.getSource())) {
            final Transducer xducer = typeRef.getTransducer();
            return new TextLoader(xducer);
        } else {
            return refs.get(typeRef).getLoader(chain.context,true);
        }
    }
View Full Code Here

     *
     * <p>
     * This allows the implementation to use an optimized code.
     */
    public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
        Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
        RuntimePropertyInfo prop = ref.getSource();

        if(prop.isCollection()) {
            return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
                    Lister.create(Navigator.REFLECTION.erasure(prop.getRawType()),prop.id(),
                    prop.getAdapter()));
        }

        if(prop.id()==ID.IDREF)
            return new IDREFTransducedAccessorImpl(prop.getAccessor());

        if(xducer.isDefault() && context != null && !context.fastBoot) {
            TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
            if(xa!=null)    return xa;
        }

        if(xducer.useNamespace())
            return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
        else
            return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
    }
View Full Code Here

            if (enumValues.length == 0) {
                throw new BuildException("Enum contains no values " + type.getName());
            }

            Transducer transducer = (Transducer) runtimeEnumLeafInfo;
            for (Enum enumValue : enumValues) {
                String enumText;
                try {
                    enumText = transducer.print(enumValue).toString();
                } catch (AccessorException e) {
                    throw new BuildException(e);
                }
                enumInfo.getEnumMap().put(enumValue, enumText);
            }
View Full Code Here

/*     */   public abstract boolean hasValue(BeanT paramBeanT)
/*     */     throws AccessorException;
/*     */
/*     */   public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref)
/*     */   {
/* 153 */     Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
/* 154 */     RuntimePropertyInfo prop = ref.getSource();
/*     */
/* 156 */     if (prop.isCollection()) {
/* 157 */       return new ListTransducedAccessorImpl(xducer, prop.getAccessor(), Lister.create(Navigator.REFLECTION.erasure(prop.getRawType()), prop.id(), prop.getAdapter()));
/*     */     }
/*     */
/* 162 */     if (prop.id() == ID.IDREF) {
/* 163 */       return new IDREFTransducedAccessorImpl(prop.getAccessor());
/*     */     }
/* 165 */     if ((xducer.isDefault()) && (!context.fastBoot)) {
/* 166 */       TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
/* 167 */       if (xa != null) return xa;
/*     */     }
/*     */
/* 170 */     if (xducer.useNamespace()) {
/* 171 */       return new CompositeContextDependentTransducedAccessorImpl(context, xducer, prop.getAccessor());
/*     */     }
/* 173 */     return new CompositeTransducedAccessorImpl(context, xducer, prop.getAccessor());
/*     */   }
View Full Code Here

/* 132 */     return (RuntimeTypeInfoSet)super.link();
/*     */   }
/*     */
/*     */   public static Transducer createTransducer(RuntimeNonElementRef ref)
/*     */   {
/* 144 */     Transducer t = ref.getTarget().getTransducer();
/* 145 */     RuntimePropertyInfo src = ref.getSource();
/* 146 */     ID id = src.id();
/*     */
/* 148 */     if (id == ID.IDREF) {
/* 149 */       return RuntimeBuiltinLeafInfoImpl.STRING;
View Full Code Here

/*  78 */     assert (prop.getTypes().size() == 1);
/*  79 */     RuntimeTypeRef ref = (RuntimeTypeRef)prop.getTypes().get(0);
/*     */
/*  81 */     this.tagName = grammar.nameBuilder.createElementName(ref.getTagName());
/*     */
/*  84 */     Transducer xducer = ref.getTransducer();
/*     */
/*  86 */     this.xacc = new ListTransducedAccessorImpl(xducer, this.acc, this.lister);
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   private Loader createItemUnmarshaller(UnmarshallerChain chain, RuntimeTypeRef typeRef)
/*     */   {
/* 231 */     if (PropertyFactory.isLeaf(typeRef.getSource())) {
/* 232 */       Transducer xducer = typeRef.getTransducer();
/* 233 */       return new TextLoader(xducer);
/*     */     }
/* 235 */     return ((JaxBeanInfo)this.refs.get(typeRef)).getLoader(chain.context, true);
/*     */   }
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.runtime.Transducer

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.