Package com.sun.codemodel

Examples of com.sun.codemodel.JDefinedClass.staticInvoke()


            dv = outline.getCodeModel().ref(org.apache.cxf.jaxb.DatatypeFactory.class)
                .staticInvoke("createDuration").arg(defaultValue);
        } else if (type instanceof JDefinedClass) {
            JDefinedClass cls = (JDefinedClass)type;
            if (cls.getClassType() == ClassType.ENUM) {
                dv = cls.staticInvoke("fromValue").arg(defaultValue);
            }
        } else if (unbox) {
            typeName = type.unboxify().fullName();
            if ("int".equals(typeName)) {
                dv = JExpr.lit(Integer.valueOf(defaultValue).intValue());
View Full Code Here


            dv = outline.getCodeModel().ref("org.apache.cxf.jaxb.DatatypeFactory")
                .staticInvoke("createDuration").arg(defaultValue);
        } else if (type instanceof JDefinedClass) {
            JDefinedClass cls = (JDefinedClass)type;
            if (cls.getClassType() == ClassType.ENUM) {
                dv = cls.staticInvoke("fromValue").arg(defaultValue);
            }
        } else if (unbox) {
            typeName = type.unboxify().fullName();
            if ("int".equals(typeName)) {
                dv = JExpr.lit(Integer.valueOf(defaultValue).intValue());
View Full Code Here

            dv = outline.getCodeModel().ref(org.apache.cxf.jaxb.DatatypeFactory.class)
                .staticInvoke("createDuration").arg(defaultValue);
        } else if (type instanceof JDefinedClass) {
            JDefinedClass cls = (JDefinedClass)type;
            if (cls.getClassType() == ClassType.ENUM) {
                dv = cls.staticInvoke("fromValue").arg(defaultValue);
            }
        }
        // TODO: GregorianCalendar, ...
        return dv;
    }
View Full Code Here

            //   throw new IllegalArgumentException(...);
            // }
            {
                JMethod m = type.method(JMod.PUBLIC|JMod.STATIC , type, "fromValue" );
                JVar $v = m.param(baseExposedType,"v");
                JForEach fe = m.body().forEach(type,"c", type.staticInvoke("values") );
                JExpression eq;
                if(baseExposedType.isPrimitive())
                    eq = fe.var().ref($value).eq($v);
                else
                    eq = fe.var().ref($value).invoke("equals").arg($v);
View Full Code Here

            //   throw new IllegalArgumentException(...);
            // }
            {
                JMethod m = type.method(JMod.PUBLIC|JMod.STATIC , type, "fromValue" );
                JVar $v = m.param(baseExposedType,"v");
                JForEach fe = m.body().forEach(type,"c", type.staticInvoke("values") );
                JExpression eq;
                if(baseExposedType.isPrimitive())
                    eq = fe.var().ref($value).eq($v);
                else
                    eq = fe.var().ref($value).invoke("equals").arg($v);
View Full Code Here

            dv = outline.getCodeModel().ref("org.apache.cxf.jaxb.DatatypeFactory")
                .staticInvoke("createDuration").arg(defaultValue);
        } else if (type instanceof JDefinedClass) {
            JDefinedClass cls = (JDefinedClass)type;
            if (cls.getClassType() == ClassType.ENUM) {
                dv = cls.staticInvoke("fromValue").arg(defaultValue);
            }
        } else if (unbox) {
            typeName = type.unboxify().fullName();
            if ("int".equals(typeName)) {
                dv = JExpr.lit(Integer.valueOf(defaultValue).intValue());
View Full Code Here

            dv = outline.getCodeModel().ref(org.apache.cxf.jaxb.DatatypeFactory.class)
                .staticInvoke("createDuration").arg(defaultValue);
        } else if (type instanceof JDefinedClass) {
            JDefinedClass cls = (JDefinedClass)type;
            if (cls.getClassType() == ClassType.ENUM) {
                dv = cls.staticInvoke("fromValue").arg(defaultValue);
            }
        }
        // TODO: GregorianCalendar, ...
        return dv;
    }
View Full Code Here

            //   throw new IllegalArgumentException(...);
            // }
            {
                JMethod m = type.method(JMod.PUBLIC | JMod.STATIC, type, "fromValue");
                JVar $v = m.param(baseExposedType, "v");
                JForEach fe = m.body().forEach(type, "c", type.staticInvoke("values"));
                JExpression eq;
                if (baseExposedType.isPrimitive()) {
                    eq = fe.var().ref($value).eq($v);
                } else {
                    eq = fe.var().ref($value).invoke("equals").arg($v);
View Full Code Here

            //   throw new IllegalArgumentException(...);
            // }
            {
                JMethod m = type.method(JMod.PUBLIC | JMod.STATIC, type, "fromValue");
                JVar $v = m.param(baseExposedType, "v");
                JForEach fe = m.body().forEach(type, "c", type.staticInvoke("values"));
                JExpression eq;
                if (baseExposedType.isPrimitive()) {
                    eq = fe.var().ref($value).eq($v);
                } else {
                    eq = fe.var().ref($value).invoke("equals").arg($v);
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.