Package org.jboss.resteasy.annotations.providers.jaxb.json

Examples of org.jboss.resteasy.annotations.providers.jaxb.json.Mapped


   @Test
   @Mapped(attributesAsElements = {"title"})
   public void testJSON() throws Exception
   {
      {
         Mapped mapped = TestJAXB.class.getMethod("testJSON").getAnnotation(Mapped.class);
         JettisonMappedContext context = new JettisonMappedContext(mapped, Book.class);
         StringWriter writer = new StringWriter();
         context.createMarshaller().marshal(new Book("Bill Burke", "666", "EJB 3.0"), writer);
         System.out.println("Mapped: ");
         String val = writer.toString();
View Full Code Here


   private ConcurrentHashMap<CacheKey, JAXBContext> mappedCollectionCache = new ConcurrentHashMap<CacheKey, JAXBContext>();
   private ConcurrentHashMap<CacheKey, JAXBContext> badgerCollectionCache = new ConcurrentHashMap<CacheKey, JAXBContext>();

   protected JAXBContext createContextObject(Annotation[] annotations, Class... classes) throws JAXBException
   {
      Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class);
      BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class);
      if (badger != null)
      {
         return new BadgerContext(classes);
      }
View Full Code Here

      }
   }

   public JAXBContext findCachedContext(Class type, MediaType mediaType, Annotation[] annotations) throws JAXBException
   {
      Mapped mapped = FindAnnotation.findAnnotation(type, annotations, Mapped.class);
      BadgerFish badger = FindAnnotation.findAnnotation(type, annotations, BadgerFish.class);
      if (badger != null)
      {
         return find(type, mediaType, badgerCache, mapped, badger);
View Full Code Here

   }

   public JAXBContext findCacheContext(MediaType mediaType, Annotation[] annotations, Class... classes) throws JAXBException
   {
      CacheKey key = new CacheKey(classes);
      Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class);
      BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class);
      if (badger != null)
      {
         JAXBContext ctx = badgerCollectionCache.get(key);
         if (ctx != null) return ctx;
View Full Code Here

   @Test
   @Mapped(attributesAsElements = {"title"})
   public void testJSON() throws Exception
   {
      {
         Mapped mapped = TestJAXB.class.getMethod("testJSON").getAnnotation(Mapped.class);
         JettisonMappedContext context = new JettisonMappedContext(mapped, Book.class);
         StringWriter writer = new StringWriter();
         context.createMarshaller().marshal(new Book("Bill Burke", "666", "EJB 3.0"), writer);
         System.out.println("Mapped: ");
         String val = writer.toString();
View Full Code Here

   private ConcurrentHashMap<CacheKey, JAXBContext> badgerCollectionCache = new ConcurrentHashMap<CacheKey, JAXBContext>();
   private ConcurrentHashMap<CacheKey, JAXBContext> badgerXmlTypeCollectionCache = new ConcurrentHashMap<CacheKey, JAXBContext>();

   protected JAXBContext createContextObject(Annotation[] annotations, Class... classes) throws JAXBException
   {
      Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class);
      BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class);
      if (badger != null)
      {
         return new BadgerContext(classes);
      }
View Full Code Here

   }

   @Override
   protected JAXBContext createContextObject(Annotation[] annotations, String contextPath) throws JAXBException
   {
      Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class);
      BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class);
      if (badger != null)
      {
         return new BadgerContext(contextPath);
      }
View Full Code Here

   @Override
   public JAXBContext findCacheXmlTypeContext(MediaType mediaType, Annotation[] annotations, Class... classes) throws JAXBException
   {
      CacheKey key = new CacheKey(classes);
      Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class);
      BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class);
      if (badger != null)
      {
         JAXBContext ctx = badgerXmlTypeCollectionCache.get(key);
         if (ctx != null) return ctx;
View Full Code Here

      }
   }

   public JAXBContext findCachedContext(Class type, MediaType mediaType, Annotation[] annotations) throws JAXBException
   {
      Mapped mapped = FindAnnotation.findAnnotation(type, annotations, Mapped.class);
      BadgerFish badger = FindAnnotation.findAnnotation(type, annotations, BadgerFish.class);
      if (badger != null)
      {
         return find(type, mediaType, badgerCache, mapped, badger);
View Full Code Here

   }

   public JAXBContext findCacheContext(MediaType mediaType, Annotation[] annotations, Class... classes) throws JAXBException
   {
      CacheKey key = new CacheKey(classes);
      Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class);
      BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class);
      if (badger != null)
      {
         JAXBContext ctx = badgerCollectionCache.get(key);
         if (ctx != null) return ctx;
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.annotations.providers.jaxb.json.Mapped

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.