Package org.jboss.metatype.api.annotations

Examples of org.jboss.metatype.api.annotations.MetaMapping


         boolean useTypeFactory, Map<String, String> propertyMetaMappings, MetaMapper[] mapperReturn)
   {
      MetaType returnType = null;
      // First look for meta mappings
      MetaMapper<?> metaMapper = null;
      MetaMapping metaMapping = getAnnotation(MetaMapping.class, info, metaData);
      MetaMappingFactory metaMappingFactory = getAnnotation(MetaMappingFactory.class, info, metaData);
      if(metaMappingFactory != null)
      {
         Class<? extends MetaMapperFactory<?>> mmfClass = metaMappingFactory.value();
         try
         {
            MetaMapperFactory<?> mmf = mmfClass.newInstance();
            String[] args = metaMappingFactory.args();
            if(args.length > 0)
               metaMapper = mmf.newInstance(args);
            else
               metaMapper = mmf.newInstance();
         }
         catch(Exception e)
         {
            log.debug("Failed to create MetaMapperFactory: "+metaMappingFactory, e);
         }
      }
      if(metaMapping != null)
      {
         // Use the mapping for the type
         Class<? extends MetaMapper<?>> mapperClass = metaMapping.value();
         try
         {
            metaMapper = mapperClass.newInstance();
         }
         catch(Exception e)
View Full Code Here


         boolean useTypeFactory, MetaMapper[] mapperReturn)
   {
      MetaType returnType = null;
      // First look for meta mappings
      MetaMapper<?> metaMapper = null;
      MetaMapping metaMapping = getAnnotation(MetaMapping.class, info, metaData);
      MetaMappingFactory metaMappingFactory = getAnnotation(MetaMappingFactory.class, info, metaData);
      if(metaMappingFactory != null)
      {
         Class<? extends MetaMapperFactory<?>> mmfClass = metaMappingFactory.value();
         try
         {
            MetaMapperFactory<?> mmf = mmfClass.newInstance();
            String[] args = metaMappingFactory.args();
            if(args.length > 0)
               metaMapper = mmf.newInstance(args);
            else
               metaMapper = mmf.newInstance();
         }
         catch(Exception e)
         {
            log.debug("Failed to create MetaMapperFactory: "+metaMappingFactory, e);
         }
      }
      if(metaMapping != null)
      {
         // Use the mapping for the type
         Class<? extends MetaMapper<?>> mapperClass = metaMapping.value();
         try
         {
            metaMapper = mapperClass.newInstance();
         }
         catch(Exception e)
View Full Code Here

         boolean useTypeFactory, MetaMapper[] mapperReturn)
   {
      MetaType returnType = null;
      // First look for meta mappings
      MetaMapper<?> metaMapper = null;
      MetaMapping metaMapping = getAnnotation(MetaMapping.class, info, metaData);
      MetaMappingFactory metaMappingFactory = getAnnotation(MetaMappingFactory.class, info, metaData);
      if(metaMappingFactory != null)
      {
         Class<? extends MetaMapperFactory<?>> mmfClass = metaMappingFactory.value();
         try
         {
            MetaMapperFactory<?> mmf = mmfClass.newInstance();
            String[] args = metaMappingFactory.args();
            if(args.length > 0)
               metaMapper = mmf.newInstance(args);
            else
               metaMapper = mmf.newInstance();
         }
         catch(Exception e)
         {
            log.debug("Failed to create MetaMapperFactory: "+metaMappingFactory, e);
         }
      }
      if(metaMapping != null)
      {
         // Use the mapping for the type
         Class<? extends MetaMapper<?>> mapperClass = metaMapping.value();
         try
         {
            metaMapper = mapperClass.newInstance();
         }
         catch(Exception e)
View Full Code Here

            managed = managementProperty.managed();
        
         // The managed property type
         MetaType metaType = null;
         MetaMapper<?> metaMapper = null;
         MetaMapping metaMapping = propertyInfo.getUnderlyingAnnotation(MetaMapping.class);
         MetaMappingFactory metaMappingFactory = propertyInfo.getUnderlyingAnnotation(MetaMappingFactory.class);
         if(metaMappingFactory != null)
         {
            Class<? extends MetaMapperFactory<?>> mmfClass = metaMappingFactory.value();
            try
            {
               MetaMapperFactory<?> mmf = mmfClass.newInstance();
               String[] args = metaMappingFactory.args();
               if(args.length > 0)
                  metaMapper = mmf.newInstance(args);
               else
                  metaMapper = mmf.newInstance();
            }
            catch(Exception e)
            {
               log.debug("Failed to create MetaMapperFactory: "+metaMappingFactory, e);
            }
         }
         if(metaMapping != null)
         {
            // Use the mapping for the type
            Class<? extends MetaMapper<?>> mapperClass = metaMapping.value();
            try
            {
               metaMapper = mapperClass.newInstance();
            }
            catch(Exception e)
View Full Code Here

         boolean useTypeFactory, MetaMapper[] mapperReturn)
   {
      MetaType returnType = null;
      // First look for meta mappings
      MetaMapper<?> metaMapper = null;
      MetaMapping metaMapping = getAnnotation(MetaMapping.class, info, metaData);
      MetaMappingFactory metaMappingFactory = getAnnotation(MetaMappingFactory.class, info, metaData);
      if(metaMappingFactory != null)
      {
         Class<? extends MetaMapperFactory<?>> mmfClass = metaMappingFactory.value();
         try
         {
            MetaMapperFactory<?> mmf = mmfClass.newInstance();
            String[] args = metaMappingFactory.args();
            if(args.length > 0)
               metaMapper = mmf.newInstance(args);
            else
               metaMapper = mmf.newInstance();
         }
         catch(Exception e)
         {
            log.debug("Failed to create MetaMapperFactory: "+metaMappingFactory, e);
         }
      }
      if(metaMapping != null)
      {
         // Use the mapping for the type
         Class<? extends MetaMapper<?>> mapperClass = metaMapping.value();
         try
         {
            metaMapper = mapperClass.newInstance();
         }
         catch(Exception e)
View Full Code Here

      ClassInfo classInfo = (ClassInfo) typeInfo;
      MetaMapper<?> mapper = typeInfo.getAttachment(MetaMapper.class);
      if (mapper != null)
         return mapper;

      MetaMapping mapping = classInfo.getUnderlyingAnnotation(MetaMapping.class);
      if (mapping == null)
         return null;
     
      try
      {
         TypeInfoFactory factory = classInfo.getTypeInfoFactory();
         ClassInfo mapperClass = (ClassInfo) factory.getTypeInfo(mapping.value());
         ConstructorInfo constructor = mapperClass.getDeclaredConstructor(null);
         mapper = (MetaMapper<?>) constructor.newInstance(null);
         typeInfo.setAttachment(MetaMapper.class.getName(), mapper);
         return mapper;
      }
View Full Code Here

         boolean useTypeFactory, MetaMapper[] mapperReturn)
   {
      MetaType returnType = null;
      // First look for meta mappings
      MetaMapper<?> metaMapper = null;
      MetaMapping metaMapping = getAnnotation(MetaMapping.class, info, metaData);
      MetaMappingFactory metaMappingFactory = getAnnotation(MetaMappingFactory.class, info, metaData);
      if(metaMappingFactory != null)
      {
         Class<? extends MetaMapperFactory<?>> mmfClass = metaMappingFactory.value();
         try
         {
            MetaMapperFactory<?> mmf = mmfClass.newInstance();
            String[] args = metaMappingFactory.args();
            if(args.length > 0)
               metaMapper = mmf.newInstance(args);
            else
               metaMapper = mmf.newInstance();
         }
         catch(Exception e)
         {
            log.debug("Failed to create MetaMapperFactory: "+metaMappingFactory, e);
         }
      }
      if(metaMapping != null)
      {
         // Use the mapping for the type
         Class<? extends MetaMapper<?>> mapperClass = metaMapping.value();
         try
         {
            metaMapper = mapperClass.newInstance();
         }
         catch(Exception e)
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.annotations.MetaMapping

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.