javax.xml.ws.BindingType Java Examples

The following examples show how to use javax.xml.ws.BindingType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AnnotatedClasses.java    From java-di with Apache License 2.0 6 votes vote down vote up
@Provides
public static AnnotatedElementLoader annotatedElementLoaderProvider() {
    return new AnnotatedElementLoader() {
        @Override
        protected List<Class<?>> load(
                Class<? extends Annotation> annoClass,
                boolean loadNonPublic,
                boolean loadAbstract
        ) {
            if (annoClass == BindingType.class) {
                if (loadNonPublic && loadAbstract) {
                    return C.list(PublicAnnotated.class, PrivateAnnotated.class, AbstractAnnotated.class);
                }
                if (loadNonPublic) {
                    return C.list(PublicAnnotated.class, PrivateAnnotated.class);
                }
                if (loadAbstract) {
                    return C.list(PublicAnnotated.class, AbstractAnnotated.class);
                }
                return C.<Class<?>>list(PublicAnnotated.class);
            }
            throw E.unsupport();
        }
    };
}
 
Example #2
Source File: BindingID.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Figures out the binding from {@link BindingType} annotation.
 *
 * @return
 *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
 * @see #parse(String)
 */
public static @NotNull BindingID parse(Class<?> implClass) {
    BindingType bindingType = implClass.getAnnotation(BindingType.class);
    if (bindingType != null) {
        String bindingId = bindingType.value();
        if (bindingId.length() > 0) {
            return BindingID.parse(bindingId);
        }
    }
    return SOAP11_HTTP;
}
 
Example #3
Source File: BindingID.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Figures out the binding from {@link BindingType} annotation.
 *
 * @return
 *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
 * @see #parse(String)
 */
public static @NotNull BindingID parse(Class<?> implClass) {
    BindingType bindingType = implClass.getAnnotation(BindingType.class);
    if (bindingType != null) {
        String bindingId = bindingType.value();
        if (bindingId.length() > 0) {
            return BindingID.parse(bindingId);
        }
    }
    return SOAP11_HTTP;
}
 
Example #4
Source File: BindingID.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Figures out the binding from {@link BindingType} annotation.
 *
 * @return
 *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
 * @see #parse(String)
 */
public static @NotNull BindingID parse(Class<?> implClass) {
    BindingType bindingType = implClass.getAnnotation(BindingType.class);
    if (bindingType != null) {
        String bindingId = bindingType.value();
        if (bindingId.length() > 0) {
            return BindingID.parse(bindingId);
        }
    }
    return SOAP11_HTTP;
}
 
Example #5
Source File: BindingID.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Figures out the binding from {@link BindingType} annotation.
 *
 * @return
 *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
 * @see #parse(String)
 */
public static @NotNull BindingID parse(Class<?> implClass) {
    BindingType bindingType = implClass.getAnnotation(BindingType.class);
    if (bindingType != null) {
        String bindingId = bindingType.value();
        if (bindingId.length() > 0) {
            return BindingID.parse(bindingId);
        }
    }
    return SOAP11_HTTP;
}
 
Example #6
Source File: BindingID.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Figures out the binding from {@link BindingType} annotation.
 *
 * @return
 *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
 * @see #parse(String)
 */
public static @NotNull BindingID parse(Class<?> implClass) {
    BindingType bindingType = implClass.getAnnotation(BindingType.class);
    if (bindingType != null) {
        String bindingId = bindingType.value();
        if (bindingId.length() > 0) {
            return BindingID.parse(bindingId);
        }
    }
    return SOAP11_HTTP;
}
 
Example #7
Source File: BindingID.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Figures out the binding from {@link BindingType} annotation.
 *
 * @return
 *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
 * @see #parse(String)
 */
public static @NotNull BindingID parse(Class<?> implClass) {
    BindingType bindingType = implClass.getAnnotation(BindingType.class);
    if (bindingType != null) {
        String bindingId = bindingType.value();
        if (bindingId.length() > 0) {
            return BindingID.parse(bindingId);
        }
    }
    return SOAP11_HTTP;
}
 
Example #8
Source File: BindingID.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Figures out the binding from {@link BindingType} annotation.
 *
 * @return
 *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
 * @see #parse(String)
 */
public static @NotNull BindingID parse(Class<?> implClass) {
    BindingType bindingType = implClass.getAnnotation(BindingType.class);
    if (bindingType != null) {
        String bindingId = bindingType.value();
        if (bindingId.length() > 0) {
            return BindingID.parse(bindingId);
        }
    }
    return SOAP11_HTTP;
}
 
Example #9
Source File: BindingID.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Figures out the binding from {@link BindingType} annotation.
 *
 * @return
 *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
 * @see #parse(String)
 */
public static @NotNull BindingID parse(Class<?> implClass) {
    BindingType bindingType = implClass.getAnnotation(BindingType.class);
    if (bindingType != null) {
        String bindingId = bindingType.value();
        if (bindingId.length() > 0) {
            return BindingID.parse(bindingId);
        }
    }
    return SOAP11_HTTP;
}
 
Example #10
Source File: JavaToWSDLProcessor.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected boolean isSOAP12() {
    if (!this.context.optionSet(ToolConstants.CFG_SOAP12)) {
        BindingType bType = getServiceClass().getAnnotation(BindingType.class);
        if (bType != null) {
            return SOAPBinding.SOAP12HTTP_BINDING.equals(bType.value());
        }
        return false;
    }
    return true;
}
 
Example #11
Source File: JavaToJSProcessor.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected boolean isSOAP12() {
    if (!this.context.optionSet(ToolConstants.CFG_SOAP12)) {
        BindingType bType = getServiceClass().getAnnotation(BindingType.class);
        if (bType != null) {
            return SOAPBinding.SOAP12HTTP_BINDING.equals(bType.value());
        }
        return false;
    }
    return true;
}
 
Example #12
Source File: JaxWsImplementorInfo.java    From cxf with Apache License 2.0 5 votes vote down vote up
public String getBindingType() {
    BindingType bType = implementorClass.getAnnotation(BindingType.class);
    if (bType != null) {
        return bType.value();
    }
    return SOAPBinding.SOAP11HTTP_BINDING;
}
 
Example #13
Source File: JaxWsImplementorInfoImpl.java    From tomee with Apache License 2.0 5 votes vote down vote up
@Override
public String getBindingType() {
    final BindingType bType = getImplementorClass().getAnnotation(BindingType.class);
    if (bType != null) {
        return bType.value();
    }

    if (this.bindingURI != null) {
        return this.bindingURI;
    }

    return SOAPBinding.SOAP11HTTP_BINDING;
}
 
Example #14
Source File: JaxWsUtils.java    From tomee with Apache License 2.0 5 votes vote down vote up
public static String getBindingUriFromAnn(final Class<?> clazz) {
    final BindingType bindingType = clazz.getAnnotation(BindingType.class);
    if (bindingType != null) {
        return bindingType.value();
    }
    return null;
}
 
Example #15
Source File: JaxWsServiceFactoryBean.java    From cxf with Apache License 2.0 4 votes vote down vote up
private void loadWSFeatureAnnotation(Class<?> serviceClass, Class<?> implementorClass) {
    List<WebServiceFeature> features = new ArrayList<>();
    MTOM mtom = implInfo.getImplementorClass().getAnnotation(MTOM.class);
    if (mtom == null && serviceClass != null) {
        mtom = serviceClass.getAnnotation(MTOM.class);
    }
    if (mtom != null) {
        features.add(new MTOMFeature(mtom.enabled(), mtom.threshold()));
    } else {
        //deprecated way to set mtom
        BindingType bt = implInfo.getImplementorClass().getAnnotation(BindingType.class);
        if (bt != null
            && (SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bt.value())
            || SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bt.value()))) {
            features.add(new MTOMFeature(true));
        }
    }


    Addressing addressing = null;
    if (implementorClass != null) {
        addressing = implementorClass.getAnnotation(Addressing.class);
    }

    if (addressing == null && serviceClass != null) {
        addressing = serviceClass.getAnnotation(Addressing.class);
    }

    if (addressing != null) {
        features.add(new AddressingFeature(addressing.enabled(),
                                           addressing.required(),
                                           addressing.responses()));
    }

    RespectBinding respectBinding = implInfo.getImplementorClass().getAnnotation(
        RespectBinding.class);
    if (respectBinding == null && serviceClass != null) {
        respectBinding = serviceClass.getAnnotation(RespectBinding.class);
    }
    if (respectBinding != null) {
        features.add(new RespectBindingFeature(respectBinding.enabled()));
    }

    if (!features.isEmpty()) {
        wsFeatures = features;
        if (setWsFeatures != null) {
            wsFeatures.addAll(setWsFeatures);
        }
    } else {
        wsFeatures = setWsFeatures;
    }
}