Package com.sun.codemodel

Examples of com.sun.codemodel.JCatchBlock.param()


                    JCatchBlock catchException = tryGetter._catch(context.toJClass(Exception.class));
                    catchException.body().invoke(builder.getReadContextVar(), "getterError")
                            .arg(builder.getXSR())
                            .arg(context.dotclass(property.getBean().getType()))
                            .arg(getter.getName())
                            .arg(catchException.param("e"));
                    catchException.body()._continue();
                } else {
                    JFieldVar propertyAccessorField = builder.getPrivatePropertyAccessor(property.getGetter(), property.getSetter(), property.getName());
                    createMapBlock.assign(mapVar, propertyAccessorField.invoke("getObject").arg(builder.getXSR()).arg(builder.getReadContextVar()).arg(beanVar));
                }
View Full Code Here


                    catchException.body().invoke(builder.getReadContextVar(), "setterError")
                            .arg(builder.getXSR())
                            .arg(context.dotclass(property.getBean().getType()))
                            .arg(setter.getName())
                            .arg(context.dotclass(setter.getParameterTypes()[0]))
                            .arg(catchException.param("e"));
                } else {
                    JFieldVar propertyAccessorField = builder.getPrivatePropertyAccessor(property.getGetter(), property.getSetter(), property.getName());
                    assignMapBlock.add(propertyAccessorField.invoke("setObject").arg(builder.getXSR()).arg(builder.getReadContextVar()).arg(beanVar).arg(mapVar));
                }
            }
View Full Code Here

            catchBody.invoke(builder.getReadContextVar(), "xmlAdapterError")
                    .arg(xsrVar)
                    .arg(context.dotclass(property.getAdapterType()))
                    .arg(context.dotclass(targetType))
                    .arg(context.dotclass(targetType))
                    .arg(catchException.param("e"));
            catchBody._continue();

            block.add(new JBlankLine());

            toSet = valueVar;
View Full Code Here

            catchBody.invoke(builder.getReadContextVar(), "xmlAdapterError")
                    .arg(xsrVar)
                    .arg(context.dotclass(property.getAdapterType()))
                    .arg(context.dotclass(targetType)) // currently we only support conversion between same type
                    .arg(context.dotclass(targetType))
                    .arg(catchException.param("e"));
            catchBody.assign(isConvertedVar, JExpr.FALSE);

            block.add(new JBlankLine());

            toSet = valueVar;
View Full Code Here

                    catchException.body().invoke(builder.getReadContextVar(), "setterError")
                            .arg(builder.getXSR())
                            .arg(context.dotclass(property.getBean().getType()))
                            .arg(setter.getName())
                            .arg(context.dotclass(setter.getParameterTypes()[0]))
                            .arg(catchException.param("e"));
                } else {
                    JFieldVar propertyAccessorField = builder.getPrivatePropertyAccessor(property.getGetter(), property.getSetter(), property.getName());
                    assignCollectionBlock.add(propertyAccessorField.invoke("setObject").arg(builder.getXSR()).arg(builder.getReadContextVar()).arg(beanVar).arg(collectionAssignment));
                }
            }
View Full Code Here

                catchException.body().invoke(builder.getReadContextVar(), "setterError")
                        .arg(builder.getXSR())
                        .arg(context.dotclass(property.getBean().getType()))
                        .arg(setter.getName())
                        .arg(context.dotclass(setter.getParameterTypes()[0]))
                        .arg(catchException.param("e"));
            } else {
                JFieldVar propertyAccessorField = builder.getPrivatePropertyAccessor(property.getGetter(), property.getSetter(), property.getName());
                block.add(propertyAccessorField.invoke("setObject").arg(builder.getXSR()).arg(builder.getReadContextVar()).arg(bean).arg(value));
            }
        } else {
View Full Code Here

                    JCatchBlock catchException = tryGetter._catch(context.toJClass(Exception.class));
                    catchException.body().invoke(builder.getReadContextVar(), "getterError")
                            .arg(builder.getXSR())
                            .arg(context.dotclass(property.getBean().getType()))
                            .arg(getter.getName())
                            .arg(catchException.param("e"));
                    catchException.body()._continue();
                } else {
                    JFieldVar propertyAccessorField = builder.getPrivatePropertyAccessor(property.getGetter(), property.getSetter(), property.getName());
                    createCollectionBlock.assign(collectionVar, propertyAccessorField.invoke("getObject").arg(builder.getXSR()).arg(builder.getReadContextVar()).arg(beanVar));
                }
View Full Code Here

                catchException.body().invoke(builder.getReadContextVar(), "getterError")
                        .arg(beanVar)
                        .arg(property.getName())
                        .arg(context.dotclass(property.getBean().getType()))
                        .arg(getter.getName())
                        .arg(catchException.param("e"));
            } else {
                JFieldVar propertyAccessorField = builder.getPrivatePropertyAccessor(property.getGetter(), property.getSetter(), property.getName());
                propertyVar.init(propertyAccessorField.invoke("getObject").arg(beanVar).arg(builder.getWriteContextVar()).arg(beanVar));
            }
        } else {
View Full Code Here

                    .arg(builder.getWriteObject())
                    .arg(property.getName())
                    .arg(context.dotclass(property.getAdapterType()))
                    .arg(context.dotclass(toClass(property.getType())))  // currently we only support conversion between same type
                    .arg(context.dotclass(toClass(property.getType())))
                    .arg(catchException.param("e"));

            //noinspection unchecked
            propertyVar = (T) valueVar;
        }
        return propertyVar;
View Full Code Here

            // add code to constructor which initializes the static dtFactory field
            JTryBlock tryBlock = constructor.body()._try();
            tryBlock.body().assign(datatypeFactory, builderContext.toJClass(DatatypeFactory.class).staticInvoke("newInstance"));

            JCatchBlock catchBlock = tryBlock._catch((builderContext.toJClass(DatatypeConfigurationException.class)));
            catchBlock.body()._throw(JExpr._new(builderContext.toJClass(RuntimeException.class)).arg("Unable to initialize DatatypeFactory").arg(catchBlock.param("e")));
        }

        return datatypeFactory;
    }
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.