Package com.sun.tools.internal.xjc.generator.bean.field

Examples of com.sun.tools.internal.xjc.generator.bean.field.FieldRendererFactory


        OptionalPropertyMode opm = getOptionalPropertyMode();
        if(prop.isCollection()) {
            CollectionTypeAttribute ct = getCollectionType();
            r = ct.get(getBuilder().model);
        } else {
            FieldRendererFactory frf = getBuilder().fieldRendererFactory;

            if(prop.isOptionalPrimitive()) {
                // the property type can be primitive type if we are to ignore absence
                switch(opm) {
                case PRIMITIVE:
                    r = frf.getRequiredUnboxed();
                    break;
                case WRAPPER:
                    // force the wrapper type
                    r = frf.getSingle();
                    break;
                case ISSET:
                    r = frf.getSinglePrimitiveAccess();
                    break;
                default:
                    throw new Error();
                }
            } else {
                r = frf.getDefault();
            }
        }
        if(opm==OptionalPropertyMode.ISSET) {
            // only isSet is allowed on a collection. these 3 modes aren't really symmetric.
View Full Code Here


            fr = calcFr(m);
        return fr;
    }

    private FieldRenderer calcFr(Model m) {
        FieldRendererFactory frf = m.options.getFieldRendererFactory();
        if (collectionType==null)
            return frf.getDefault();

        if (collectionType.equals("indexed"))
            return frf.getArray();

        return frf.getList(m.codeModel.ref(collectionType));
    }
View Full Code Here

        Attr a = element.getAttributeNode("collection");
        if(a==null)     return null;

        String v = element.getAttribute("collection").trim();

        FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
        if(v.equals("array"))   return frf.getArray();
        if(v.equals("list"))
            return frf.getList(
                parent.parent.codeModel.ref(ArrayList.class));

        // the correctness of the attribute value must be
        // checked by the validator.
        throw new InternalError("unexpected collection value: "+v);
View Full Code Here

            fr = calcFr(m);
        return fr;
    }

    private FieldRenderer calcFr(Model m) {
        FieldRendererFactory frf = m.options.getFieldRendererFactory();
        if (collectionType==null)
            return frf.getDefault();

        if (collectionType.equals("indexed"))
            return frf.getArray();

        return frf.getList(m.codeModel.ref(collectionType));
    }
View Full Code Here

        Attr a = element.getAttributeNode("collection");
        if(a==null)     return null;

        String v = element.getAttribute("collection").trim();

        FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
        if(v.equals("array"))   return frf.getArray();
        if(v.equals("list"))
            return frf.getList(
                parent.parent.codeModel.ref(ArrayList.class));

        // the correctness of the attribute value must be
        // checked by the validator.
        throw new InternalError("unexpected collection value: "+v);
View Full Code Here

        OptionalPropertyMode opm = getOptionalPropertyMode();
        if(prop.isCollection()) {
            CollectionTypeAttribute ct = getCollectionType();
            r = ct.get(getBuilder().model);
        } else {
            FieldRendererFactory frf = getBuilder().fieldRendererFactory;

            if(prop.isOptionalPrimitive()) {
                // the property type can be primitive type if we are to ignore absence
                switch(opm) {
                case PRIMITIVE:
                    r = frf.getRequiredUnboxed();
                    break;
                case WRAPPER:
                    // force the wrapper type
                    r = frf.getSingle();
                    break;
                case ISSET:
                    r = frf.getSinglePrimitiveAccess();
                    break;
                default:
                    throw new Error();
                }
            } else {
                r = frf.getDefault();
            }
        }
        if(opm==OptionalPropertyMode.ISSET) {
            // only isSet is allowed on a collection. these 3 modes aren't really symmetric.
View Full Code Here

TOP

Related Classes of com.sun.tools.internal.xjc.generator.bean.field.FieldRendererFactory

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.