Examples of CollectionValue


Examples of com.volantis.shared.metadata.value.CollectionValue

    // Javadoc inherited.
    protected Collection verify(final MetaDataValue value, final String path) {
        final Collection errors =  super.verify(value, path);
        if (value instanceof CollectionValue) {
            final CollectionValue collectionValue = (CollectionValue) value;
            final Collection contents =
                collectionValue.getContentsAsCollection();
            // check member type constraint
            if (memberTypeConstraint != null) {
                final MetaDataTypeImpl memberType =
                    (MetaDataTypeImpl) memberTypeConstraint.getMemberType();
                final Iterator iter = contents.iterator();
View Full Code Here

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

      ManagedObject mo = managedObjects.get(TranslatorMetaDataGroup.class.getName());
      if (mo != null) {
        ManagedProperty translators = mo.getProperty("translators"); //$NON-NLS-1$
        MetaType propType = translators.getMetaType();
        if (propType.isCollection()) {
          CollectionValue value = (CollectionValue) translators.getValue();
          if (value != null) {
            for (MetaValue element:value.getElements()) {
              ManagedObject translator = (ManagedObject)((GenericValue)element).getValue();
              managedObjects.put(translator.getName(), translator);
            }
          }
        }
View Full Code Here

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

  public static <T> void getCollectionValue(ManagedCommon mc, String prop, Collection<T> list, Class<T> expectedType) {
     ManagedProperty mp = mc.getProperty(prop);
     if (mp != null) {
       MetaType metaType = mp.getMetaType();
       if (metaType.isCollection()) {
         CollectionValue collectionValue = (CollectionValue)mp.getValue();
         for(MetaValue value:collectionValue.getElements()) {
           if (value.getMetaType().isSimple()) {
             SimpleValue simpleValue = (SimpleValue)value;
             list.add(expectedType.cast(simpleValue.getValue()));
           }
           else {
View Full Code Here

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

    {
        LOG.debug("GetMetaValue for property: " + propertyList.getName() + " values: " + propertyList.getList().toString());
        CollectionMetaType collectionMetaType = (CollectionMetaType)metaType;
        MetaType memberMetaType = collectionMetaType.getElementType();
        CollectionMetaType collectionType = new CollectionMetaType(propertyListDefinition.getName(), memberMetaType);
        CollectionValue collectionValue = new CollectionValueSupport(collectionType);
        populateMetaValueFromProperty(propertyList, collectionValue, propertyListDefinition);
        return collectionValue;
    }
View Full Code Here

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

        {
            // Since we want to load the PropertyList with fresh values, we want it cleared out.
            propList.getList().clear();
            if (metaValue != null)
            {
                CollectionValue collectionValue = (CollectionValue)metaValue;
                MetaType listMemberMetaType = collectionValue.getMetaType().getElementType();
                MetaValue[] listMemberValues = collectionValue.getElements();
                PropertyAdapter propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(listMemberMetaType);
                for (MetaValue listMemberValue : listMemberValues)
                {
                    Property listMemberProp = propertyAdapter.convertToProperty(listMemberValue, memberPropDef);
                    propList.add(listMemberProp);
View Full Code Here

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

      assertEquals("correct number of standard bindings", offsets.size(), compVal.values().size());
      for (String bindingSetName : offsets.keySet())
      {
         MetaValue mv = compVal.get(bindingSetName);
         assertTrue(mv instanceof CollectionValue);
         CollectionValue colVal = (CollectionValue) mv;
         sawAdded = false;
         for (MetaValue element : colVal.getElements())
         {
            if ("AddedStandardBinding".equals(getSimpleValue(element, "serviceName")))
            {
               sawAdded = true;
               assertEquals("correct bindingName in set " + bindingSetName,
View Full Code Here

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

      assertEquals("correct number of sets of actual bindings", offsets.size(), compVal.values().size());
      for (String bindingSetName : offsets.keySet())
      {
         MetaValue mv = compVal.get(bindingSetName);
         assertTrue(mv instanceof CollectionValue);
         CollectionValue colVal = (CollectionValue) mv;
         getLog().info(colVal.getElements());
         for (MetaValue element : colVal.getElements())
         {
            serviceBindingTest(element);
         }
      }
     
View Full Code Here

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

      CollectionMetaType resultCMT = (CollectionMetaType) resultType;
      MetaType resultElementType = resultCMT.getElementType();
      log.debug("resultElementType: "+resultElementType);
      assertTrue("resultElementType instanceof CompositeMetaType", resultElementType instanceof CompositeMetaType);
      log.debug("resultElementType: "+resultElementType);
      CollectionValue listAllMessagesCV = (CollectionValue) listAllMessagesMV;
      MetaValue[] listAllMessagesElements = listAllMessagesCV.getElements();
      log.debug("listAllMessagesElements: "+listAllMessagesElements);
      if(listAllMessagesElements.length > 0)
      {
         MetaValue m0 = listAllMessagesElements[0];
         MetaType m0MT = m0.getMetaType();
View Full Code Here

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

      ManagedOperation listNonDurableSubscriptions = opsByName.get("listNonDurableSubscriptions");
      assertNotNull(listNonDurableSubscriptions);
      MetaValue subscriptions = listNonDurableSubscriptions.invoke();
      log.info(subscriptions);
      assertTrue(subscriptions instanceof CollectionValue);
      CollectionValue subscriptionsCV = (CollectionValue) subscriptions;
      assertTrue("subscriptions.size > 0", subscriptionsCV.getSize() > 0);
      MetaValue[] subscriptionsMVs = subscriptionsCV.getElements();
      for(MetaValue mv : subscriptionsMVs)
      {
         CompositeValue cv = (CompositeValue) mv;
         MetaValue name = cv.get("name");
         log.info(name);
View Full Code Here

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

         SimpleValue nondurable = (SimpleValue)component.getProperty("nonDurableSubscriptionsCount").getValue();
         SimpleValue durable = (SimpleValue)component.getProperty("durableSubscriptionsCount").getValue();
         SimpleValue all = (SimpleValue)component.getProperty("allSubscriptionsCount").getValue();
         SimpleValue allMessageCount = (SimpleValue)component.getProperty("allMessageCount").getValue();
        
         CollectionValue messageCounters = (CollectionValue) component.getProperty("messageCounters").getValue();
         assertNotNull(messageCounters);
        
         assertEquals(1, nondurable.getValue());
         assertEquals(0, durable.getValue());
         assertEquals(1, all.getValue());
         assertEquals(10, allMessageCount.getValue());
  
         CompositeValue messageCounter = (CompositeValue) messageCounters.iterator().next();
         assertNotNull(messageCounter);
        
         SimpleValue count = (SimpleValue) messageCounter.get("messageCount");
         assertEquals(count, allMessageCount);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.