Package org.jboss.metatype.api.values

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


                String mapMemberDesc = (propDefMap.getDescription() != null) ? propDefMap.getDescription() : "none";
                MetaType mapMemberMetaType = ConversionUtils.convertPropertyDefinitionToMetaType(mapMemberPropDef);
                compositeMetaType.addItem(mapMemberPropDef.getName(), mapMemberDesc, mapMemberMetaType);
            }
        }
        return new CompositeValueSupport(compositeMetaType);
    }
View Full Code Here


    }

    // NOTE: We can't just leverage PropertyMapToCompositeValueSupportAdapter, because we have to skip the "name" map member.
    private void populateMetaValueFromProperty(PropertyMap propMap, MetaValue metaValue,
        PropertyDefinitionMap propDefMap) {
        CompositeValueSupport compositeValue = (CompositeValueSupport) metaValue;
        for (String mapMemberPropName : propMap.getMap().keySet()) {
            if (mapMemberPropName.equals("name"))
                continue;
            Property mapMemberProp = propMap.get(mapMemberPropName);
            PropertyDefinition mapMemberPropDef = propDefMap.get(mapMemberPropName);
            MetaType mapMemberMetaType = compositeValue.getMetaType().getType(mapMemberPropName);
            if (mapMemberMetaType == null) {
                // this will occur when new map properties are added since they are not present
                // in the original metaValue which we are using
                mapMemberMetaType = SimpleMetaType.STRING;
            }
            PropertyAdapter adapter = PropertyAdapterFactory.getPropertyAdapter(mapMemberMetaType);
            MetaValue mapMemberMetaValue = adapter.convertToMetaValue(mapMemberProp, mapMemberPropDef,
                mapMemberMetaType);
            compositeValue.set(mapMemberPropName, mapMemberMetaValue);
        }
    }
View Full Code Here

      assertNotNull("security-domain.deploymentType", sdCV.get("securityDeploymentType"));
      assertEquals("APPLICATION", ((EnumValue) sdCV.get("securityDeploymentType")).getValue());
      assertFalse(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
     
      // Set a new security domain and check if the metaType changed
      CompositeValueSupport newSecDomain = new CompositeValueSupport(compType);
      newSecDomain.set("domain", SimpleValueSupport.wrap("test"));
      newSecDomain.set("securityDeploymentType", new EnumValueSupport(
            (EnumMetaType) compType.getType("securityDeploymentType"),
            SecurityDeploymentType.DOMAIN_AND_APPLICATION));
      secDomain.setValue(newSecDomain);
     
      assertTrue(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
View Full Code Here

            new SimpleValueSupport(SimpleMetaType.STRING, "changed"));
      valueMap.put("integer", new SimpleValueSupport(
            SimpleMetaType.INTEGER_PRIMITIVE, 111));

      //
      p.setValue(new CompositeValueSupport(composite.getMetaType(), valueMap));

      ManagedProperty property = deployment.getProperty("name");
      assertNotNull(property);
      property.setValue(SimpleValueSupport.wrap("ChangedName"));
     
View Full Code Here

     
      map.put("read", new SimpleValueSupport(SimpleMetaType.BOOLEAN, read));
      map.put("write", new SimpleValueSupport(SimpleMetaType.BOOLEAN, write));
      map.put("create", new SimpleValueSupport(SimpleMetaType.BOOLEAN, create));
     
      return new CompositeValueSupport(composite, map);
   }
View Full Code Here

      changedMap.put("integer", new SimpleValueSupport(
            (SimpleMetaType) integer.getMetaType(), 111));
     
      // Set new values
      p.setValue(
            new CompositeValueSupport(nested.getMetaType(), changedMap)
            );

      // Save and restore
      PersistedManagedObject restored = restore(mo);
      assertNotNull(restored);
View Full Code Here

         // Role name
         String name = na.getValue();
         // the role values
         Map<String, MetaValue> values = parseAttributes(role, attributes);
         // Put
         entries.put(name, new CompositeValueSupport(composite, values));
      }
      return new MapCompositeValueSupport(entries, metaType);
   }
View Full Code Here

      map.put("read", new SimpleValueSupport(SimpleMetaType.BOOLEAN, read));
      map.put("write", new SimpleValueSupport(SimpleMetaType.BOOLEAN, write));
      map.put("create", new SimpleValueSupport(SimpleMetaType.BOOLEAN, create));

      return new CompositeValueSupport(compositeMetaType, map);
   }
View Full Code Here

      // A metadata type with a null type-mapping, JBAS-6215
      MutableCompositeMetaType metadataType = new MutableCompositeMetaType("org.jboss.resource.metadata.mcf.DBMSMetaData", "metadata type");
      metadataType.addItem("typeMapping", "The jdbc type mapping", SimpleMetaType.STRING);
      HashMap<String, MetaValue> items = new HashMap<String, MetaValue>();
      items.put("typeMapping", null);
      CompositeValueSupport metadata = new CompositeValueSupport(metadataType, items);
      propValues.put("metadata", metadata);

      // todo: connection-properties
   }
View Full Code Here

     
      map.put("read", new SimpleValueSupport(SimpleMetaType.BOOLEAN, read));
      map.put("write", new SimpleValueSupport(SimpleMetaType.BOOLEAN, write));
      map.put("create", new SimpleValueSupport(SimpleMetaType.BOOLEAN, create));
     
      return new CompositeValueSupport(composite, map);
   }
View Full Code Here

TOP

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

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.