Package org.jboss.metatype.api.values

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


         T attachment)
   {
      MetaValue value = null;
      if("connection-properties".equals(property.getName()))
      {
         MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
         List<DataSourceConnectionPropertyMetaData> list = attachment.getDataSourceConnectionProperties();
         if(list != null)
         {
            for(DataSourceConnectionPropertyMetaData prop : list)
            {
               MetaValue wrapped = SimpleValueSupport.wrap(prop.getValue());
               mapValue.put(prop.getName(), wrapped);
            }
         }
         value = mapValue;
      }
      else
View Full Code Here


         if((value instanceof MapCompositeValueSupport) == false)
         {
            return super.unwrapValue(beanInfo, property, value);
         }
   
         MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;
        
         List<DataSourceConnectionPropertyMetaData> list = new ArrayList<DataSourceConnectionPropertyMetaData>();
         for(String name : mapValue.getMetaType().keySet())
         {
            DataSourceConnectionPropertyMetaData prop = new DataSourceConnectionPropertyMetaData();
            prop.setName(name);
            String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name));
            prop.setValue(svalue);
            list.add(prop);
         }
         unwrapValue = list;
      }
View Full Code Here

      if("xa-datasource-properties".equals(property.getName()))
      {
         List<XAConnectionPropertyMetaData> list = attachment.getXADataSourceProperties();
         if(list != null)
         {
            MapCompositeValueSupport map = new MapCompositeValueSupport(SimpleMetaType.STRING);
            for(XAConnectionPropertyMetaData prop : list)
            {
               MetaValue svalue = SimpleValueSupport.wrap(prop.getValue());
               map.put(prop.getName(), svalue);
            }
            metaValue = map;
         }
      }
      else
View Full Code Here

         if((value instanceof MapCompositeValueSupport) == false)
         {
            return super.unwrapValue(beanInfo, property, value);
         }
        
         MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;        
        
         List<XAConnectionPropertyMetaData> list = new ArrayList<XAConnectionPropertyMetaData>();
         for(String name : mapValue.getMetaType().keySet())
         {
            XAConnectionPropertyMetaData prop = new XAConnectionPropertyMetaData();
            prop.setName(name);
            String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name));
            prop.setValue(svalue);
            list.add(prop);
         }
         unwrapValue = list;
      }
View Full Code Here

         return null;
     
      MetaValue value = null;
      if("config-property".equals(property.getName()))
      {
         MapCompositeValueSupport mapValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
         List<ManagedConnectionFactoryPropertyMetaData> list = attachment.getManagedConnectionFactoryProperties();
         if(list != null)
         {
            for(ManagedConnectionFactoryPropertyMetaData prop : list)
            {
               String name = prop.getName();              
               MetaValue svalue = SimpleValueSupport.wrap(prop.getValue());
               mapValue.put(name, svalue);
               MetaValue stype = SimpleValueSupport.wrap(prop.getType());
               mapValue.put(name+".type", stype);
            }
         }
         value = mapValue;
      }
      else
View Full Code Here

         if((value instanceof MapCompositeValueSupport) == false)
         {
            return super.unwrapValue(beanInfo, property, value);
         }
        
         MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;
        
         List<ManagedConnectionFactoryPropertyMetaData> list = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
         for(String name : mapValue.getMetaType().keySet())
         {
            // Ignore the type we've added before
            if(name.endsWith(".type"))
               continue;
           
            ManagedConnectionFactoryPropertyMetaData prop = new ManagedConnectionFactoryPropertyMetaData();
            prop.setName(name);
            String svalue = (String) getMetaValueFactory().unwrap(mapValue.get(name));
            prop.setValue(svalue);
            String nameType = name+".type";
            MetaValue typeValue = mapValue.get(nameType);
            if(typeValue != null)
            {
               String type = (String) getMetaValueFactory().unwrap(typeValue);
               prop.setType(type);
            }
View Full Code Here

     
      Map<String, String> values = new HashMap<String, String>();
      values.put("key1", "value1");
      values.put("key2", "value2");
      values.put("key3", "value3");
      MapCompositeValueSupport expected = new MapCompositeValueSupport(SimpleMetaType.STRING);
      expected.put("key1", SimpleValueSupport.wrap("value1"));
      expected.put("key2", SimpleValueSupport.wrap("value2"));
      expected.put("key3", SimpleValueSupport.wrap("value3"));
      MetaValue result = createMetaValue(values, mapSignature);
      CompositeValue actual = assertInstanceOf(result, CompositeValue.class);
      getLog().debug("Composite Value: " + actual);
      assertEquals(expected, actual);
View Full Code Here

      Properties values = new Properties();
      values.put("key1", "value1");
      values.put("key2", "value2");
      values.put("key3", "value3");

      MapCompositeValueSupport expected = new MapCompositeValueSupport(SimpleMetaType.STRING);
      expected.put("key1", SimpleValueSupport.wrap("value1"));
      expected.put("key2", SimpleValueSupport.wrap("value2"));
      expected.put("key3", SimpleValueSupport.wrap("value3"));
      MetaValue result = createMetaValue(values, propertiesType);
      CompositeValue actual = assertInstanceOf(result, CompositeValue.class);
      getLog().debug("Composite Value: " + actual);
      assertEquals(expected, actual);
   }
View Full Code Here

      MetaMappingUsage values = new MetaMappingUsage();
      values.setName("testMetaMappingComposite");
      values.setType("java.lang.String");
      values.setValue("testMetaMappingComposite-value");

      MapCompositeValueSupport expected = new MapCompositeValueSupport(SimpleMetaType.STRING);
      expected.put("name", SimpleValueSupport.wrap("testMetaMappingComposite"));
      expected.put("type", SimpleValueSupport.wrap("java.lang.String"));
      expected.put("value", SimpleValueSupport.wrap("testMetaMappingComposite-value"));

      MetaValue result = createMetaValue(values, type);
      CompositeValue actual = assertInstanceOf(result, CompositeValue.class);
      getLog().debug("Composite Value: " + actual);
      assertEquals(expected, actual);
View Full Code Here

   }

   @Override
   public MetaValue createMetaValue(MetaType metaType, MetaMappingUsage object)
   {
      MapCompositeValueSupport metaValue = new MapCompositeValueSupport(SimpleMetaType.STRING);
      metaValue.put("name", SimpleValueSupport.wrap(object.getName()));
      metaValue.put("value", SimpleValueSupport.wrap(object.getValue()));
      metaValue.put("type", SimpleValueSupport.wrap(object.getType()));
      return metaValue;
   }
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.