Package org.jboss.beans.info.spi

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


    String propertyName = property.getMappedName();
    if (propertyName == null)
      propertyName = property.getName();

    // Get the property info
    PropertyInfo propertyInfo = property.getField(Fields.PROPERTY_INFO, PropertyInfo.class);
    if (propertyInfo == null)
      propertyInfo = beanInfo.getProperty(propertyName);

    // Check if the property is readable
    if (propertyInfo != null && propertyInfo.isReadable() == false)
      return null;

    MetaValue value = null;
    if (TRANSLATOR_PROPERTY.equals(property.getName())) {
      MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
View Full Code Here


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

    PropertyInfo propertyInfo = getField(Fields.PROPERTY_INFO,PropertyInfo.class);
    if (propertyInfo != null) {
      Object attachment = getManagedObject().getAttachment();
      if (attachment != null) {
        MetaValue metaValue = value;
        InstanceClassFactory icf = getMOFactory().getInstanceClassFactory(attachment.getClass());
        BeanInfo beanInfo = propertyInfo.getBeanInfo();
        icf.setValue(beanInfo, this, attachment, metaValue);
      }
    }
  }
View Full Code Here

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

      PropertyInfo propertyInfo = getField(Fields.PROPERTY_INFO, PropertyInfo.class);
      if (propertyInfo != null)
      {
         Object attachment = getManagedObject().getAttachment();
         if (attachment != null)
         {
            InstanceClassFactory icf = getMOFactory().getInstanceClassFactory(attachment.getClass());
            BeanInfo beanInfo = propertyInfo.getBeanInfo();
            icf.setValue(beanInfo, this, attachment, value);
         }
      }
   }
View Full Code Here

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

      PropertyInfo propertyInfo = getField(Fields.PROPERTY_INFO, PropertyInfo.class);
      if (propertyInfo != null)
      {
         Object attachment = getManagedObject().getAttachment();
         if (attachment != null)
         {
            MetaValue metaValue = value;
            InstanceClassFactory icf = getMOFactory().getInstanceClassFactory(attachment.getClass());
            BeanInfo beanInfo = propertyInfo.getBeanInfo();
            icf.setValue(beanInfo, this, attachment, metaValue);
         }
      }
   }
View Full Code Here

      String propertyName = property.getMappedName();
      if(propertyName == null)
         propertyName = property.getName();
     
      // Get the property info
      PropertyInfo propertyInfo = property.getField(Fields.PROPERTY_INFO, PropertyInfo.class);
      if(propertyInfo == null)
         propertyInfo = beanInfo.getProperty(propertyName);

      // Check if the property is readable
      if(propertyInfo != null && propertyInfo.isReadable() == false)
         return null;
     
      MetaValue value = null;
      if("config-property".equals(property.getName()))
      {
View Full Code Here

      // Get the property from the bean
      // First look to the mapped name
      String name = property.getMappedName();
      if (name == null)
         name = property.getName();
      PropertyInfo propertyInfo = property.getField(Fields.PROPERTY_INFO, PropertyInfo.class);
      if(propertyInfo == null)
         propertyInfo = beanInfo.getProperty(name);
     
      Object bean = locateBean(attachment.getName());
      MetaValue mvalue = null;
      if(propertyInfo.isReadable() == false)
      {
         if(log.isTraceEnabled())
            log.trace("Skipping get of non-readable property: "+propertyInfo);
         return null;
      }

      try
      {
         String getterClassName = propertyInfo.getGetter().getDeclaringClass().getName();
         if(getterClassName.equals(attachment.getClass().getName()))
         {
            // use attachment
            mvalue = delegateICF.getValue(beanInfo, property, metaData, attachment);
         }
         else if(bean != null)
         {
            // use bean (if installed)
            mvalue = delegateICF.getValue(beanInfo, property, metaData, bean);
         }
         else
         {
            // Try to find the property in the meta data
            PropertyMetaData md = null;
            if(attachment.getProperties() != null && attachment.getProperties().isEmpty() == false)
            {
               for(PropertyMetaData bp : attachment.getProperties())
               {
                  if(name.equals(bp.getName()))
                  {
                     md = bp;
                     break;
                  }
               }
               if(md != null)
               {
                  // TODO add metaMapping
                  if(md.getValue() != null)
                  {
                     mvalue = metaValueFactory.create(md.getValue().getUnderlyingValue(),
                           propertyInfo.getType());
                  }
               }
            }
         }
      }
      catch(Throwable e)
      {
         log.debug("Failed to get property value for bean: "+beanInfo.getName()
               +", property: "+propertyInfo.getName(), e);
         mvalue = metaValueFactory.create(null, propertyInfo.getType());
         return mvalue;
      }

      return mvalue;
   }
View Full Code Here

      {
         ClassLoader loader = getClassLoader(attachment);
         // Set the mbean class loader as the TCL
         SecurityActions.setContextClassLoader(loader);

         PropertyInfo propertyInfo = property.getField(Fields.PROPERTY_INFO, PropertyInfo.class);
         if(propertyInfo == null)
            propertyInfo = beanInfo.getProperty(name);
         if(propertyInfo == null)
            throw new IllegalArgumentException("No matching property found: " + name + "/" + beanName);
        
         if(propertyInfo.isWritable() == false)
         {
            if(log.isTraceEnabled())
               log.trace("Skipping get of non-writable property: "+propertyInfo);
            return;
         }
         Object plainValue = unwrapValue(property, propertyInfo.getType(), value);
         Object bean = locateBean(beanName);
        
         // Only update the bean if installed
         if(bean != null)
            propertyInfo.set(bean, plainValue);
        
         BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(attachment);
         builder.addPropertyMetaData(name, plainValue);
        
      }
View Full Code Here

    * @param metaData the property metadata
    * @throws Throwable for any error
    */
   public static void configure(boolean trace, Object object, BeanInfo info, ClassLoader cl, PropertyMetaData metaData) throws Throwable
   {
      PropertyInfo ainfo = resolveProperty(trace, info, metaData.getName());
      configure(trace, object, ainfo, cl, metaData);
   }
View Full Code Here

    * @throws Throwable for any error
    */
   public static TargettedJoinpoint getPropertyGetterJoinPoint(BeanInfo info, String property) throws Throwable
   {
      boolean trace = log.isTraceEnabled();
      PropertyInfo ainfo = resolveProperty(trace, info, property);
      return getPropertyGetterJoinPoint(trace, ainfo);
   }
View Full Code Here

    * @return the joinpoint
    * @throws Throwable for any error
    */
   public static TargettedJoinpoint getPropertySetterJoinPoint(boolean trace, BeanInfo info, ClassLoader cl, PropertyMetaData metaData) throws Throwable
   {
      PropertyInfo ainfo = resolveProperty(trace, info, metaData.getName());
      return getPropertySetterJoinPoint(trace, ainfo, cl, metaData.getValue());
   }
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.