Package org.apache.cxf.databinding

Examples of org.apache.cxf.databinding.WrapperHelper


    private static WrapperHelper createWrapperHelper(Class<?> wrapperType, Method setMethods[],
                                                     Method getMethods[], Method jaxbMethods[],
                                                     Field fields[], Object objectFactory) {

        WrapperHelper wh = compileWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                                objectFactory);

        if (wh == null) {
            wh = new JAXBWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                       objectFactory);
View Full Code Here


   
    private static WrapperHelper createWrapperHelper(Class<?> wrapperType, Method setMethods[],
                                                     Method getMethods[], Method jaxbMethods[],
                                                     Field fields[], Object objectFactory) {

        WrapperHelper wh = compileWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                                objectFactory);

        if (wh == null) {
            wh = new JAXBWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                       objectFactory);
View Full Code Here

    private static WrapperHelper createWrapperHelper(Class<?> wrapperType, Method setMethods[],
                                                     Method getMethods[], Method jaxbMethods[],
                                                     Field fields[], Object objectFactory) {

        WrapperHelper wh = compileWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                                objectFactory);

        if (wh == null) {
            wh = new JAXBWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                       objectFactory);
View Full Code Here

        newClassName = periodToSlashes(newClassName);

        Class<?> cls = super.findClass(newClassName.replace('/', '.'), wrapperType);
        while (cls != null) {
            try {
                WrapperHelper helper = WrapperHelper.class.cast(cls.newInstance());
                if (!helper.getSignature().equals(computeSignature())) {
                    count++;
                    newClassName = wrapperType.getName() + "_WrapperTypeHelper" + count;
                    newClassName = newClassName.replaceAll("\\$", ".");
                    newClassName = periodToSlashes(newClassName);
                    cls = super.findClass(newClassName.replace('/', '.'), wrapperType);
View Full Code Here

            }
            if (wrapperClass == null || wrappedObject == null) {
                return;
            }
           
            WrapperHelper helper = wrapperPart.getProperty("WRAPPER_CLASS", WrapperHelper.class);
            if (helper == null) {
                Service service = ServiceModelUtil.getService(message.getExchange());
                DataBinding dataBinding = service.getDataBinding();
                if (dataBinding instanceof WrapperCapableDatabinding) {
                    helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding,
                                                 messageInfo, wrappedMessageInfo, wrapperClass);
                    wrapperPart.setProperty("WRAPPER_CLASS", helper);
                } else {
                    return;
                }               
            }           
           
            MessageContentsList newParams;
            try {
                newParams = new MessageContentsList(helper.getWrapperParts(wrappedObject));
               
                List<Integer> removes = null;
                int count = 0;
                for (MessagePartInfo part : messageInfo.getMessageParts()) {
                    if (Boolean.TRUE.equals(part.getProperty(ReflectionServiceFactoryBean.HEADER))) {
View Full Code Here

        }

        if (wrapped != null) {
            MessageContentsList objs = MessageContentsList.getContentsList(message);

            WrapperHelper helper = parts.get(0).getProperty("WRAPPER_CLASS", WrapperHelper.class);
            if (helper == null) {
                Service service = ServiceModelUtil.getService(message.getExchange());
                DataBinding dataBinding = service.getDataBinding();
                if (dataBinding instanceof WrapperCapableDatabinding) {
                    helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding,
                                                 messageInfo, wrappedMsgInfo, wrapped);
                    parts.get(0).setProperty("WRAPPER_CLASS", helper);
                } else {
                    return;
                }
            }
            try {
                MessageContentsList newObjs = new MessageContentsList();
                Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
                // set the validate option for XMLBeans Wrapper Helper
                if (Boolean.TRUE.equals(en) || "true".equals(en)) {
                    try {                       
                        Class<?> xmlBeanWrapperHelperClass =
                            Class.forName("org.apache.cxf.xmlbeans.XmlBeansWrapperHelper");
                        if (xmlBeanWrapperHelperClass.isInstance(helper)) {
                            Method method = xmlBeanWrapperHelperClass.getMethod("setValidate", boolean.class);
                            method.invoke(helper, true);
                        }
                    } catch (Exception exception) {
                        // do nothing there
                    }
                }
                Object o2 = helper.createWrapperObject(objs);
                newObjs.put(parts.get(0), o2);
               
                for (MessagePartInfo p : messageInfo.getMessageParts()) {
                    if (Boolean.TRUE.equals(p.getProperty(ReflectionServiceFactoryBean.HEADER))) {
                        MessagePartInfo mpi = wrappedMsgInfo.getMessagePart(p.getName());
View Full Code Here

    private static WrapperHelper createWrapperHelper(Class<?> wrapperType, Method setMethods[],
                                                     Method getMethods[], Method jaxbMethods[],
                                                     Field fields[], Object objectFactory) {

        WrapperHelper wh = compileWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                                objectFactory);

        if (wh == null) {
            wh = new JAXBWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                       objectFactory);
View Full Code Here

        List<Class<?>> partClasses = Arrays.asList(new Class<?>[] {List.class});
          
        String className = requestClass.getName();
        className = className.substring(0, className.lastIndexOf(".") + 1);
       
        WrapperHelper wh = new JAXBDataBinding().createWrapperHelper(requestClass, null,
                                                             partNames, elTypeNames, partClasses);       
       
        List<Object> paraList = new ArrayList<Object>();
        List<String> valueList = new ArrayList<String>();
        valueList.add("str1");
        valueList.add("str2");
        valueList.add("str3");
        paraList.add(valueList);
        Object requestObj = wh.createWrapperObject(paraList);
        // Create response wrapper Object
       
        partNames = Arrays.asList(new String[] {"return"});
        elTypeNames = Arrays.asList(new String[] {"list"});
        partClasses = Arrays.asList(new Class<?>[] {List.class});
          
        className = responseClass.getName();
        className = className.substring(0, className.lastIndexOf(".") + 1);
       
        wh = new JAXBDataBinding().createWrapperHelper(responseClass, null,
                                                             partNames, elTypeNames, partClasses);       
        List<Object> resPara = new ArrayList<Object>();
        List<Integer> intValueList = new ArrayList<Integer>();
        intValueList.add(1);
        intValueList.add(2);
        intValueList.add(3);
        resPara.add(intValueList);
        Object responseObj = wh.createWrapperObject(resPara);
             
        JAXBContext jaxbContext = JAXBContext.newInstance(requestClass, responseClass);
        java.io.ByteArrayOutputStream bout = new java.io.ByteArrayOutputStream();
        Marshaller marshaller = jaxbContext.createMarshaller();
       
View Full Code Here

   
    private static WrapperHelper createWrapperHelper(Class<?> wrapperType, Method setMethods[],
                                                     Method getMethods[], Method jaxbMethods[],
                                                     Field fields[], Object objectFactory) {

        WrapperHelper wh = compileWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                                objectFactory);

        if (wh == null) {
            wh = new JAXBWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                       objectFactory);
View Full Code Here

   
    private static WrapperHelper createWrapperHelper(Class<?> wrapperType, Method setMethods[],
                                                     Method getMethods[], Method jaxbMethods[],
                                                     Field fields[], Object objectFactory) {

        WrapperHelper wh = compileWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                                objectFactory);

        if (wh == null) {
            wh = new JAXBWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
                                       objectFactory);
View Full Code Here

TOP

Related Classes of org.apache.cxf.databinding.WrapperHelper

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.