Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.MapCompositeValueSupport


    if (propertyInfo != null && propertyInfo.isReadable() == false)
      return null;

    MetaValue value = null;
    if (TRANSLATOR_PROPERTY.equals(property.getName())) {
      MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
      List<PropertyMetadata> list = attachment.getJAXBProperties();
      if (list != null) {
        for (PropertyMetadata prop : list) {
          String name = prop.getName();
          MetaValue svalue = SimpleValueSupport.wrap(prop.getValue());
          mapValue.put(name, svalue);
        }
      }
      value = mapValue;
    } else {
      value = super.getValue(beanInfo, property, metaData, attachment);
View Full Code Here


     
      if ((value instanceof MapCompositeValueSupport) == false) {
        return super.unwrapValue(beanInfo, property, value);
      }

      MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;

      List<PropertyMetadata> list = new ArrayList<PropertyMetadata>();
      for (String name : mapValue.getMetaType().keySet()) {
        list.add(new PropertyMetadata(name, (String) getMetaValueFactory().unwrap(mapValue.get(name))));
      }
      unwrapValue = list;
    } else {
      unwrapValue = super.unwrapValue(beanInfo, property, value);
    }
View Full Code Here

    }
    return false;
  }

  public static MapCompositeValueSupport compositeValueMap(Map<String, String> map) {
    MapCompositeValueSupport metaValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
    for (String key : map.keySet()) {
      MetaValue value = SimpleValueSupport.wrap(map.get(key));
      metaValue.put(key, value);
    }
    return metaValue;
 
View Full Code Here

       if (metaType.isProperties()) {
         return (PropertiesMetaValue)mp.getValue();
       }
       else if (metaType.isComposite()) {
        Properties props = new Properties();
        MapCompositeValueSupport map = (MapCompositeValueSupport) mp.getValue();
        MapCompositeMetaType type = map.getMetaType();
        for (String key : type.keySet()) {
          MetaValue value = map.get(key);
          props.setProperty(key, stringValue(value));
        }
        return props;
       }
       throw new IllegalArgumentException(prop+ " is not a properties type"); //$NON-NLS-1$
View Full Code Here

    if (name.equals(ADDITIONAL_CONNECTION_PROPS)) {
      Map<String, String> map = new HashMap<String, String>();
      parseProperties(value, map);
     
      // update the container managed object.
      MapCompositeValueSupport previousValues = (MapCompositeValueSupport)main.getProperty("connection-properties").getValue(); //$NON-NLS-1$
      if (previousValues != null) {
        for (String key:map.keySet()) {
          previousValues.put(key, SimpleValueSupport.wrap(map.get(key)));
        }
      }
    }
  }
View Full Code Here

      else {
        map.put(name, value);
      }
     
      // update the container managed object.
      MapCompositeValueSupport previousValues = (MapCompositeValueSupport)main.getProperty("xa-datasource-properties").getValue(); //$NON-NLS-1$
      if (previousValues != null) {
        for (String key:map.keySet()) {
          previousValues.put(key, SimpleValueSupport.wrap(map.get(key)));
        }
      }
    }
  }
View Full Code Here

    }
  }

  static void updateManagedConnectionFactory(String name, String value, ManagedComponent mc) {
    // Update the Container connection factory
    MapCompositeValueSupport previousValues = (MapCompositeValueSupport)mc.getProperty("config-property").getValue(); //$NON-NLS-1$
    if (previousValues != null) {
      previousValues.put(name, SimpleValueSupport.wrap(value));
    }
  }
View Full Code Here

public class PropertyMapToMapCompositeValueSupportAdapter extends AbstractPropertyMapToCompositeValueAdapter implements PropertyAdapter<PropertyMap, PropertyDefinitionMap>
{
    @Override
    public void populateMetaValueFromProperty(PropertyMap propMap, MetaValue metaValue, PropertyDefinitionMap propDefMap)
    {
        MapCompositeValueSupport mapCompositeValueSupport = (MapCompositeValueSupport)metaValue;
        // First clear out all existing values from the MapCompositeValue.
        for (String key : mapCompositeValueSupport.getMetaType().keySet())
        {
            mapCompositeValueSupport.remove(key);
        }
        // Now re-populate it with the values from the PropertyMap.
        super.populateMetaValueFromProperty(propMap, metaValue, propDefMap);
    }
View Full Code Here

        super.populateMetaValueFromProperty(propMap, metaValue, propDefMap);
    }

    protected void putValue(CompositeValue compositeValue, String key, MetaValue value)
    {
        MapCompositeValueSupport mapCompositeValueSupport = (MapCompositeValueSupport)compositeValue;
        mapCompositeValueSupport.put(key, value);
    }
View Full Code Here

    protected CompositeValue createCompositeValue(PropertyDefinitionMap propDefMap, MetaType metaType)
    {
        MapCompositeMetaType mapCompositeMetaType = (MapCompositeMetaType)metaType;
        MetaType mapMemberMetaType = mapCompositeMetaType.getValueType();
        return new MapCompositeValueSupport(mapMemberMetaType);
    }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.values.MapCompositeValueSupport

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.