本文整理汇总了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;未经允许,请勿转载。 |
请发表评论