Examples of Mapped


Examples of com.tobedevoured.modelcitizen.annotation.Mapped

                logger.trace("  Setting default for {} to {} and forced {}", new Object[]{defaultField.getName(), defaultField.getValue(), defaultField.isForce()});

            }

            // Process @Mapped
            Mapped mapped = field.getAnnotation(Mapped.class);
            if (mapped != null) {
                MappedField mappedField = new MappedField();
                mappedField.setName(field.getName());

                if (field.getAnnotation(Nullable.class) != null) {
                    mappedField.setNullable(true);
                }

                // If @Mapped(target) not set, use Field's class
                if (NotSet.class.equals(mapped.target())) {
                    mappedField.setTarget(field.getType());

                    // Use @Mapped(target) for MappedField#target
                } else {
                    mappedField.setTarget(mapped.target());
                }

                mappedField.setFieldClass(field.getType());
                modelFields.add(mappedField);
View Full Code Here

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

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

   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

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

      }
   }

   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

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

   }

   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

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

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

   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

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

   }

   @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

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

   @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

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

      }
   }

   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
TOP
Copyright © 2018 www.massapi.com. 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.