Package org.jboss.metatype.spi.values

Examples of org.jboss.metatype.spi.values.MetaMapper


      Set<ManagedOperation> ops = q1MO.getOperations();
      ManagedOperation listAllMessages = ManagedOperationMatcher.findOperation(ops, "listAllMessages");
      assertNotNull(listAllMessages);
      MetaType returnType = listAllMessages.getReturnType();
      assertEquals(MessageListMapper.TYPE, returnType);
      MetaMapper returnTypeMapper = listAllMessages.getTransientAttachment(MetaMapper.class);
      assertNotNull(returnTypeMapper);
      assertTrue(returnTypeMapper instanceof MessageListMapper);
   }
View Full Code Here


      MetaType returnType = listAllMessages.getReturnType();
      assertEquals(MessageListMapper.TYPE, returnType);
      ManagedParameter[] params = listAllMessages.getParameters();
      assertEquals(1, params.length);
      assertEquals(SimpleMetaType.STRING, params[0].getMetaType());
      MetaMapper mapper = params[0].getTransientAttachment(MetaMapper.class);
      assertNotNull(mapper);
      assertTrue(mapper instanceof StringObjectNameMetaMapper);
   }
View Full Code Here

         {
            log.debug("Failed to get value from mbean for: "+name, e);
         }
  
         PropertyInfo propertyInfo = beanInfo.getProperty(name);
         MetaMapper metaMapper = property.getTransientAttachment(MetaMapper.class);
         try
         {
            if(metaMapper != null)
            {
               mvalue = metaMapper.createMetaValue(property.getMetaType(), value);
            }
            else
            {
               mvalue = metaValueFactory.create(value, propertyInfo.getType());
            }
View Full Code Here

        
         // Unwrap the value before, so that we can recreate empty values
         Object plainValue = null;
         // Look for a MetaMapper
         MetaType propertyType = property.getMetaType();
         MetaMapper metaMapper = property.getTransientAttachment(MetaMapper.class);
         Type mappedType = null;
         if(metaMapper != null)
         {
            mappedType = metaMapper.mapToType();
            plainValue = metaMapper.unwrapMetaValue(value);
         }
         else
         {
            PropertyInfo propertyInfo = beanInfo.getProperty(name);
            plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());
View Full Code Here

TOP

Related Classes of org.jboss.metatype.spi.values.MetaMapper

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.