javax.ws.rs.container.PreMatching源码实例Demo

类javax.ws.rs.container.PreMatching源码实例Demo

下面列出了javax.ws.rs.container.PreMatching 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: cxf   文件: ServerProviderFactory.java
@Override
public Map<Class<?>, Integer> getContracts(Class<?> cls) {
    Map<Class<?>, Integer> map = new HashMap<>();
    if (isRegistered(cls)) {
        if (ContainerRequestFilter.class.isAssignableFrom(cls)) {
            boolean isPreMatch = cls.getAnnotation(PreMatching.class) != null;
            map.put(ContainerRequestFilter.class,
                    getPriority(isPreMatch ? preMatchContainerRequestFilters
                        : postMatchContainerRequestFilters.values(), cls, ContainerRequestFilter.class));
        }
        if (ContainerResponseFilter.class.isAssignableFrom(cls)) {
            map.put(ContainerResponseFilter.class,
                    getPriority(containerResponseFilters.values(), cls, ContainerResponseFilter.class));
        }
        if (WriterInterceptor.class.isAssignableFrom(cls)) {
            map.put(WriterInterceptor.class,
                    getPriority(writerInterceptors.values(), cls, WriterInterceptor.class));
        }
        if (ReaderInterceptor.class.isAssignableFrom(cls)) {
            map.put(ReaderInterceptor.class,
                    getPriority(readerInterceptors.values(), cls, ReaderInterceptor.class));
        }
    }
    return map;
}
 
源代码2 项目: dremio-oss   文件: TestMediaTypeFilter.java
@Test
public void testAnnotations() {
  // Check that the class is correctly annotated
  assertNotNull("@PreMatching annotation is required to modify headers", MediaTypeFilter.class.getAnnotation(PreMatching.class));
  Priority priority = MediaTypeFilter.class.getAnnotation(Priority.class);
  assertNotNull("@Priority annotation is required to modify headers", priority);

  assertTrue("priority should be higher than HEADER_DECORATOR", priority.value() <= Priorities.HEADER_DECORATOR);
}
 
源代码3 项目: cxf   文件: ServerProviderFactory.java
protected static boolean isPrematching(Class<?> filterCls) {
    return AnnotationUtils.getClassAnnotation(filterCls, PreMatching.class) != null;
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法