• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Annotations类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.fasterxml.jackson.jaxrs.cfg.Annotations的典型用法代码示例。如果您正苦于以下问题:Java Annotations类的具体用法?Java Annotations怎么用?Java Annotations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Annotations类属于com.fasterxml.jackson.jaxrs.cfg包,在下文中一共展示了Annotations类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getRegistryClient

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
private RegistryEndpoints getRegistryClient(ImageRef imageRef) {
	if (!proxyClients.containsKey(imageRef.getRegistryUrl())) {

		ObjectMapper mapper = new ObjectMapper();
		mapper.registerModule(new JavaTimeModule());

		Client client = ClientBuilder.newClient()
				.register(new JacksonJaxbJsonProvider(mapper, new Annotations[] {Annotations.JACKSON}))
				.register(JacksonFeature.class);
		String auth = config.getAuthFor(imageRef.getRegistryName());
		if (auth != null) {
			String[] credentials = new String(Base64.getDecoder().decode(auth), StandardCharsets.UTF_8).split(":");
			client.register(HttpAuthenticationFeature.basicBuilder().credentials(credentials[0], credentials[1]));
		}
		WebTarget webTarget = client.target(imageRef.getRegistryUrl());
		proxyClients.put(imageRef.getRegistryUrl(), WebResourceFactory.newResource(RegistryEndpoints.class, webTarget));
	}
	return proxyClients.get(imageRef.getRegistryUrl());
}
 
开发者ID:swissquote,项目名称:carnotzet,代码行数:20,代码来源:DockerRegistry.java


示例2: getSingletons

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
@Override
public synchronized Set<Object> getSingletons(String alias) {

    Logger logger = LoggerFactory.getLogger(JacksonManagerProvider.class);

    Set<Object> singletons = new HashSet<>();

    for (JacksonJaxrsService jacksonJaxrsProvider : jaxrsProviders) {
        try {
            ObjectMapper objectMapper = (ObjectMapper)jacksonJaxrsProvider.getMapperClass().newInstance();
            registerModulesWithObjectMapper(objectMapper);
            Annotations[] annotations = {Annotations.JACKSON, Annotations.JAXB};
            singletons.add(jacksonJaxrsProvider.getProviderClass().getConstructor(objectMapper.getClass(), Annotations[].class).newInstance(objectMapper, annotations));
        }
        catch (Exception ex) {
            logger.error("Exception creating JAXRS provider", ex);
        }
    }

    return singletons;
}
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:22,代码来源:JacksonManagerProvider.java


示例3: createProviders

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
public static List<Object> createProviders(ObjectMapper objectMapper) {
    ArrayList providers = new ArrayList();
    Annotations[] annotationsToUse = JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS;
    providers.add(new JacksonJaxbJsonProvider(objectMapper, annotationsToUse));
    providers.add(new ExceptionResponseMapper());
    return providers;
}
 
开发者ID:fabric8io,项目名称:fabric8-devops,代码行数:8,代码来源:ElasticsearchClient.java


示例4: get

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
@Override
protected HttpHandler get(Injector injector, Configurations configurations) {

    /* Setup our object mapper (could be qualified with path) */
    final ObjectMapper mapper = getInstance(injector, ObjectMapper.class, path);

    final Map<Class<?>, Integer> contractPriorities = new HashMap<>();
    contractPriorities.put(MessageBodyWriter.class, Integer.MIN_VALUE);
    contractPriorities.put(MessageBodyReader.class, Integer.MIN_VALUE);
    config.register(new JacksonJsonProvider(mapper,
                new Annotations[] { Annotations.JACKSON, Annotations.JAXB }),
                Collections.unmodifiableMap(contractPriorities));

    /* Create a ServiceLocator parent of all locators and inject the configurations */
    final ServiceLocator locator = ServiceLocatorFactory.create(injector, path);

    /* Set up the ObjectMapper that will be used by this application */
    ServiceLocatorUtilities.addOneConstant(locator, mapper, null, ObjectMapper.class);

    /* Create a brand new Grizzly HTTP container from Jersey */
    log.debug("Jersey application at \"%s\" initializing", path.value());
    GrizzlyHttpContainer container = GrizzlyHttpContainerFactory.create(config, locator);
    log.info("Jersey application at \"%s\" initialized successfully", path.value());

    /* Create our handler and add it to our server configuration  */
    final HttpServer server = injector.getInstance(HttpServer.class);
    server.getServerConfiguration().addHttpHandler(container, path.value());
    log.info("Serving \"%s\" using Jersey application \"%s\"", path.value(), config.getApplicationName());

    /* All done! */
    return container;
}
 
开发者ID:usrz,项目名称:java-libs-httpd,代码行数:33,代码来源:RestHandlerProvider.java


示例5: JacksonProvider

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
/**
 * @param mapper
 * @param annotationsToUse
 */
public JacksonProvider(ObjectMapper mapper, Annotations[] annotationsToUse) {
    super(mapper, annotationsToUse);
    mapper.setVisibility(PropertyAccessor.FIELD, Visibility.NONE);
    mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PROTECTED_AND_PUBLIC);
    mapper.setVisibility(PropertyAccessor.SETTER, Visibility.PROTECTED_AND_PUBLIC);
    mapper.configure(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS, true);
    mapper.setPropertyNamingStrategy(getPropertyNamingStrategy());
}
 
开发者ID:minnal,项目名称:minnal,代码行数:13,代码来源:JacksonProvider.java


示例6: JacksonProvider

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
/**
 * @param mapper
 * @param annotationsToUse
 */
public JacksonProvider(ObjectMapper mapper, Annotations[] annotationsToUse) {
	super(mapper, annotationsToUse);
	mapper.setVisibility(PropertyAccessor.FIELD, Visibility.NONE);
	mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PROTECTED_AND_PUBLIC);
	mapper.setVisibility(PropertyAccessor.SETTER, Visibility.PROTECTED_AND_PUBLIC);
	mapper.configure(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS, true);
	mapper.setPropertyNamingStrategy(getPropertyNamingStrategy());
}
 
开发者ID:minnal,项目名称:minnal,代码行数:13,代码来源:JacksonProvider.java


示例7: GedcomxAtomJsonProvider

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
protected GedcomxAtomJsonProvider(ObjectMapper mapper, Annotations[] annotationsToUse, Class<?> instanceClass, MediaType mt) {
  super(mapper, annotationsToUse);

  this.rootClass = Feed.class;
  this.mt = mt;
  this.instanceClass = instanceClass == null ? this.rootClass : instanceClass;
}
 
开发者ID:FamilySearch,项目名称:gedcomx-java,代码行数:8,代码来源:GedcomxAtomJsonProvider.java


示例8: GedcomJsonProvider

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
protected GedcomJsonProvider(ObjectMapper mapper, Annotations[] annotationsToUse, Class<?> instanceClass, MediaType mt) {
  super(mapper, annotationsToUse);

  this.rootClass = Gedcomx.class;
  this.mt = mt;
  this.instanceClass = instanceClass == null ? this.rootClass : instanceClass;
}
 
开发者ID:FamilySearch,项目名称:gedcomx-java,代码行数:8,代码来源:GedcomJsonProvider.java


示例9: MessageBodyWriterJSON

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
public MessageBodyWriterJSON(Annotations... annotationsToUse) {
    super(annotationsToUse);
}
 
开发者ID:eserating,项目名称:siren4j,代码行数:4,代码来源:MessageBodyWriterJSON.java


示例10: ValidatingJacksonJaxbJsonProvider

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
public ValidatingJacksonJaxbJsonProvider(Validator validator, ObjectMapper objectMapper, Annotations[] defaultAnnotations) {
    super(objectMapper, defaultAnnotations);
    this.validator = validator;
}
 
开发者ID:redbooth,项目名称:baseline,代码行数:5,代码来源:ValidatingJacksonJaxbJsonProvider.java


示例11: RdapJsonProvider

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
public RdapJsonProvider(Annotations... annotations) {
    this(null, annotations);
}
 
开发者ID:RIPE-NCC,项目名称:whois,代码行数:4,代码来源:RdapJsonProvider.java


示例12: RestJacksonJsonProvider

import com.fasterxml.jackson.jaxrs.cfg.Annotations; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param annotationsToUse annotations to use
 */
public RestJacksonJsonProvider(Annotations... annotationsToUse) {
    this(new RestJsonMapper(), annotationsToUse);
}
 
开发者ID:WegenenVerkeer,项目名称:common-resteasy,代码行数:9,代码来源:RestJacksonJsonProvider.java



注:本文中的com.fasterxml.jackson.jaxrs.cfg.Annotations类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RenderPig类代码示例发布时间:2022-05-22
下一篇:
Java MUCUser类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap