Package org.jboss.beans.info.spi

Examples of org.jboss.beans.info.spi.PropertyInfo


               break;
            }
         }

         // Unwrap
         PropertyInfo propertyInfo = beanInfo.getProperty(name);
         Object plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());
        
         // There may not be an attribute value, see if there is a matching property
         if (attributeValue == null)
         {
            // FIXME ignore null values
View Full Code Here


            if (imetaData != null)
               annotation = imetaData.getAnnotation(annotationType);
         }
         if (annotation == null && info instanceof PropertyInfo)
         {
            PropertyInfo pi = (PropertyInfo) info;
            if(pi.getGetter() != null)
            {
               Signature mis = new MethodSignature(pi.getGetter());
               MetaData imetaData = metaData.getComponentMetaData(mis);
               if (imetaData != null)
                  annotation = imetaData.getAnnotation(annotationType);
            }
            if(annotation == null && pi.getSetter() != null)
            {
               Signature mis = new MethodSignature(pi.getSetter());
               MetaData imetaData = metaData.getComponentMetaData(mis);
               if (imetaData != null)
                  annotation = imetaData.getAnnotation(annotationType);
            }
            if(annotation == null && pi.getFieldInfo() != null)
            {
               Signature fis = new FieldSignature(pi.getFieldInfo());
               MetaData imetaData = metaData.getComponentMetaData(fis);
               if (imetaData != null)
                  annotation = imetaData.getAnnotation(annotationType);
            }
         }
View Full Code Here

         T attachment, MetaValue value)
   {
      if (beanInfo != null && property != null && value != null)
      {
         String name = getPropertyName(property);
         PropertyInfo propertyInfo = beanInfo.getProperty(name);

         ManagementRuntimeRef componentRef = propertyInfo.getUnderlyingAnnotation(ManagementRuntimeRef.class);
         if (componentRef != null)
         {
            Object original = this.unwrapValue(beanInfo, property, value);
            try
            {
               Class<? extends RuntimeComponentNameTransformer> tClass = componentRef.transformer();
               RuntimeComponentNameTransformer transformer;
               if (tClass != ManagementRuntimeRef.DEFAULT_NAME_TRANSFORMER.class)
                  transformer = getComponentNameTransformer(configuration.getTypeInfo(tClass));
               else
                  transformer = getComponentNameTransformer(propertyInfo.getType());

               return (transformer != null) ? transformer.transform(original) : original;
            }
            catch (Throwable t)
            {
View Full Code Here

   public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property,
         MetaData metaData, T object)
   {
      String name = getPropertyName(property);
      PropertyInfo propertyInfo = beanInfo.getProperty(name);

      Object value;
      try
      {
         value = propertyInfo.get(object);
      }
      catch (RuntimeException e)
      {
         throw e;
      }
View Full Code Here

    * @param value the meta value
    */
   public void setValue(BeanInfo beanInfo, ManagedProperty property, T object, MetaValue value)
   {
      String name = getPropertyName(property);
      PropertyInfo propertyInfo = beanInfo.getProperty(name);

      Object unwrapValue = unwrapValue(beanInfo, property, value);
      try
      {
         if(unwrapValue instanceof ManagedObject)
View Full Code Here

   }

   protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property, MetaValue value)
   {
      String name = getPropertyName(property);
      PropertyInfo propertyInfo = beanInfo.getProperty(name);
      // Look for a property MetaMapper
      MetaMapper metaMapper = property.getTransientAttachment(MetaMapper.class);
      if(metaMapper != null)
      {
         return metaMapper.unwrapMetaValue(value);
      }
      return metaValueFactory.unwrap(value, propertyInfo.getType());
   }
View Full Code Here

         {
            for(TestInjectionTargetMetaData targetMD : injectMD.getInjectionTargets())
            {
               ValueMetaData injectValue = beanBuilder.createInject(injectMD.getResolvedJndiName());
               String targetName = targetMD.getInjectionTargetName();
               PropertyInfo pinfo = beanInfo.getProperty(targetName);
               if(pinfo != null)
               {
                  beanBuilder.addPropertyMetaData(targetName, injectValue);
               }
               else
View Full Code Here

      Set<PropertyMetaData> propertys = metaData.getProperties();
      if (propertys != null && propertys.isEmpty() == false)
      {
         for (PropertyMetaData pmd : propertys)
         {
            PropertyInfo pi = info.getProperty(pmd.getName());
            ValueMetaData value = pmd.getValue();
            pi.set(bean, value.getValue(pi.getType(), Configurator.getClassLoader(metaData)));
         }
      }
   }
View Full Code Here

   }

   protected void configure(Object bean, BeanInfo info, PropertyMetaData metaData) throws Throwable
   {
      ClassLoader cl = getClass().getClassLoader();
      PropertyInfo pi = info.getProperty(metaData.getName());
      pi.set(bean, metaData.getValue().getValue(pi.getType(), cl));
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   public void setValue(Serializable value)
   {
      super.setValue(value);

      PropertyInfo propertyInfo = getField(Fields.PROPERTY_INFO, PropertyInfo.class);
      if (propertyInfo != null)
      {
         Serializable attachment = getManagedObject().getAttachment();
         if (attachment != null)
         {
            MetaValue metaValue;
            if (value instanceof MetaValue == false)
               metaValue = getValueFactory().create(value, propertyInfo.getType());
            else
               metaValue = (MetaValue)value;

            InstanceClassFactory icf = getObjectFactory().getInstanceClassFactory(attachment.getClass());
            BeanInfo beanInfo = propertyInfo.getBeanInfo();
            icf.setValue(beanInfo, this, attachment, metaValue);
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.beans.info.spi.PropertyInfo

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.