Package org.jboss.metatype.api.types

Examples of org.jboss.metatype.api.types.CompositeMetaType


   {
      if(metaValue == null)
         return null;
     
      MapCompositeValueSupport value = (MapCompositeValueSupport) metaValue;
      CompositeMetaType metaType = value.getMetaType();
      // Don't create a empty set
      if(metaType.itemSet().isEmpty())
         return null;
     
      // Create the dom document
      Document d = createDocument();
      // Security
      Element security = d.createElement("security");
      // Get the roles
      for(String name : metaType.itemSet())
      {
         // Role
         CompositeValue row = (CompositeValue) value.get(name);
         if(row == null)
            continue;
View Full Code Here


                                CollectionMetaType collMetaType = (CollectionMetaType) propType;
                                LOG.info("\t\t\tCollection Sub Type: " + collMetaType.getTypeName());
                            }
                            if (propType.isComposite())
                            {
                                CompositeMetaType compositeType = (CompositeMetaType) propType;
                                Set<String> items = compositeType.itemSet();
                                for (String itemName : items)
                                {
                                    LOG.info("\t\t\tComposite Sub Type: " + compositeType.getType(itemName).getTypeName());
                                }
                            }
                        }
                    }
                    LOG.info("***********************************************");
 
View Full Code Here

        metaTypeInstances.put(GENERIC_TYPE, new GenericMetaType("String", "Just something"));
        SimpleValue simpleValue = SimpleValueSupport.wrap("SimpleValue");
        SimpleMetaType simpleMetaType = simpleValue.getMetaType();
        metaTypeInstances.put(SIMPLE_TYPE, simpleMetaType);
        CompositeMetaType compositeMetaType = new MutableCompositeMetaType("String", "Just something");
        metaTypeInstances.put(COMPOSITE_TYPE, compositeMetaType);
        CompositeMetaType mapCompositeMetaType = new MapCompositeMetaType(SimpleMetaType.STRING);
        metaTypeInstances.put(MAP_COMPOSITE_TYPE, mapCompositeMetaType);
        CollectionMetaType collectionMetaType = new CollectionMetaType("ClassName", simpleMetaType);
        metaTypeInstances.put(COLLECTION_TYPE, collectionMetaType);
        ArrayMetaType arrayMetaType = new ArrayMetaType(2, simpleMetaType);
        metaTypeInstances.put(ARRAY_TYPE, arrayMetaType);
View Full Code Here

    }

    public void populatePropertyFromMetaValue(PropertyList propertyList, MetaValue metaValue,
        PropertyDefinitionList propertyDefinitionList) {
        CompositeValue compositeValue = (CompositeValue) metaValue;
        CompositeMetaType compositeMetaType = compositeValue.getMetaType();
        PropertyDefinitionMap memberPropertyDefinitionMap = (PropertyDefinitionMap) propertyDefinitionList
            .getMemberDefinition();
        PropertyMapToMapCompositeValueSupportAdapter mapToMapCompositeValueAdapter = new PropertyMapToMapCompositeValueSupportAdapter();
        for (String memberName : compositeMetaType.itemSet()) {
            MetaValue memberMetaValue = compositeValue.get(memberName);
            PropertyMap memberPropertyMap = mapToMapCompositeValueAdapter.convertToProperty(memberMetaValue,
                memberPropertyDefinitionMap);
            memberPropertyMap.put(new PropertySimple("name", memberName)); // add a simple for the role name to the map
            propertyList.add(memberPropertyMap);
View Full Code Here

      String driverClassName = lds.getDriverClass();
      assertEquals("org.jboss.jdbc.ClusteredDriver", driverClassName);
      // Validate the security-domain
      ManagedProperty secDomain = mo.getProperty("security-domain");
      assertNotNull("security-domain", secDomain);
      CompositeMetaType compType = (CompositeMetaType) secDomain.getMetaType();
      assertNotNull(compType);
      CompositeValue sdCV = (CompositeValue) secDomain.getValue();
      assertNotNull("security-domain.CV", sdCV);

      SimpleValue domainName = (SimpleValue) sdCV.get("domain");
      assertNotNull("security-domain.domain", domainName);
      assertEquals(SimpleValueSupport.wrap("java:/jaas/SomeDomain"), domainName);
      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

      {
         return (MapCompositeValueSupport) toClone.clone();
      }
      else
      {
         CompositeMetaType type = toClone.getMetaType();
         Map<String, MetaValue> map = new HashMap<String, MetaValue>();
         for (String key : type.keySet())
         {
            map.put(key, toClone.get(key));
         }
         return new MapCompositeValueSupport(map, type);
      }
View Full Code Here

         return null;
     
      if(metaValue instanceof MapCompositeValueSupport)
      {
         MapCompositeValueSupport value = (MapCompositeValueSupport) metaValue;
         CompositeMetaType metaType = value.getMetaType();
         // Don't create a empty securityConfig
         if(metaType.itemSet().isEmpty())
            return null;
        
         // Create the dom document
         Document d = createDocument();
         // Security
         Element security = d.createElement("security");
         for(String name : metaType.itemSet())
         {
            // Role
            CompositeValue row = (CompositeValue) value.get(name);
            // FIXME the MapMetaType might not be up 2 date
            if(row == null)
View Full Code Here

      {
         return (MapCompositeValueSupport) toClone.clone();
      }
      else
      {
         CompositeMetaType type = toClone.getMetaType();
         Map<String, MetaValue> map = new HashMap<String, MetaValue>();
         for (String key : type.keySet())
         {
            map.put(key, toClone.get(key));
         }
         return new MapCompositeValueSupport(map, type);
      }
View Full Code Here

      assertEquals("type-mapping", SimpleValueSupport.wrap("Hypersonic SQL"), p.getValue());
*/
      p = props.get("security-domain");
      assertNotNull("security-domain", p);

      CompositeMetaType secType = (CompositeMetaType) p.getMetaType();
      assertNotNull(secType);
      assertTrue(secType.containsItem("domain"));
      assertTrue(secType.containsItem("securityDeploymentType"));

      log.info("security-domain: "+secType);
   }
View Full Code Here

      {
         return (MapCompositeValueSupport) toClone.clone();
      }
      else
      {
         CompositeMetaType type = toClone.getMetaType();
         Map<String, MetaValue> map = new HashMap<String, MetaValue>();
         for (String key : type.keySet())
         {
            map.put(key, toClone.get(key));
         }
         return new MapCompositeValueSupport(map, type);
      }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.types.CompositeMetaType

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.