javax.ws.rs.NameBinding Java Examples

The following examples show how to use javax.ws.rs.NameBinding. 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: ProviderRenderUtil.java    From dropwizard-guicey with MIT License 6 votes vote down vote up
@SuppressWarnings({"checkstyle:NPathComplexity", "PMD.NPathComplexity"})
private static List<String> collectMarkers(final Class<?> ext,
                                           final Class<?> provider,
                                           final boolean isHkManaged,
                                           final boolean isLazy) {
    final List<String> markers = new ArrayList<>();
    if (isHkManaged) {
        markers.add("jersey managed");
    }
    if (isLazy) {
        markers.add("lazy");
    }
    if (ExceptionMapper.class.equals(ext) && ExtendedExceptionMapper.class.isAssignableFrom(provider)) {
        markers.add("extended");
    }
    final Annotation filter = FeatureUtils.getAnnotatedAnnotation(provider, NameBinding.class);
    if (filter != null) {
        markers.add("only @" + filter.annotationType().getSimpleName());
    }
    return markers;
}
 
Example #2
Source File: AnnotationUtils.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static Set<String> getNameBindings(Annotation[] targetAnns) {
    if (targetAnns.length == 0) {
        return Collections.emptySet();
    }
    Set<String> names = new LinkedHashSet<>();
    for (Annotation a : targetAnns) {
        NameBinding nb = a.annotationType().getAnnotation(NameBinding.class);
        if (nb != null) {
            names.add(a.annotationType().getName());
        }
    }
    return names;
}
 
Example #3
Source File: RateLimitedTest.java    From dropwizard-ratelimit with Apache License 2.0 4 votes vote down vote up
@Test
public void annotationNameBindingExistsOnClass() {
    assertTrue((describe(RateLimited.class).getAnnotation(NameBinding.class) != null));
}