Examples of MetaValue


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

            Map<String, Property> properties = property.getMap();
            for (String key : map.keySet())
            {
                PropertyDefinition definition = map.get(key);
                MetaValue[] getKey = new MetaValue[]{SimpleValueSupport.wrap(key)};
                MetaValue value = tableValueSupport.get(getKey);
                Property innerProperty = properties.get(key);
                PropertyAdapter adapter = PropertyAdapterFactory.getPropertyAdapter(value);
                adapter.populateMetaValueFromProperty(innerProperty, value, definition);
            }
        }
View Full Code Here

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

                // 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);
            putValue(compositeValue, mapMemberPropName, mapMemberMetaValue);
        }
    }
View Full Code Here

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

        Set<String> mapMemberPropNames = compositeValue.getMetaType().keySet();
        // There won't be any keys when loading a Configuration for the first time.
        for (String mapMemberPropName : mapMemberPropNames)
        {
            Property mapMemberProp = propMap.get(mapMemberPropName);
            MetaValue mapMemberMetaValue = compositeValue.get(mapMemberPropName);
            MetaType mapMemberMetaType = compositeValue.getMetaType().getType(mapMemberPropName);
            PropertyAdapter propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(mapMemberMetaType);
            PropertyDefinition mapMemberPropDef = propDefMap.get(mapMemberPropName);
            if (mapMemberProp == null)
            {
View Full Code Here

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

  @Test public void testMapping() {
    SessionMetadata session = new SessionMetadata();
    session.setSessionId("test");
    session.setApplicationName("foo");
    SessionMetadataMapper smm = new SessionMetadataMapper();
    MetaValue mv = smm.createMetaValue(smm.getMetaType(), session);
   
    SessionMetadata session1 = smm.unwrapMetaValue(mv);
   
    assertEquals(session.getSessionId(), session1.getSessionId());
    assertEquals(session.getApplicationName(), session1.getApplicationName());
View Full Code Here

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

  @Test public void testMapping() {
    RequestMetadata request = new RequestMetadata();
    request.setState(ProcessingState.PROCESSING);
   
    RequestMetadataMapper rmm = new RequestMetadataMapper();
    MetaValue mv = rmm.createMetaValue(rmm.getMetaType(), request);
   
    RequestMetadata request1 = rmm.unwrapMetaValue(mv);
   
    assertEquals(request.getState(), request1.getState());
  }
View Full Code Here

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

  @Test public void testMapping() {
    TransactionMetadata tm = new TransactionMetadata();
    tm.setAssociatedSession("x");

    TransactionMetadataMapper tmm = new TransactionMetadataMapper();
    MetaValue mv = tmm.createMetaValue(tmm.getMetaType(), tm);
   
    TransactionMetadata tm1 = tmm.unwrapMetaValue(mv);
   
    assertEquals(tm.getAssociatedSession(), tm1.getAssociatedSession());
  }
View Full Code Here

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

    PropertyInfo propertyInfo = getField(Fields.PROPERTY_INFO,PropertyInfo.class);
    if (propertyInfo != null) {
      Object attachment = getManagedObject().getAttachment();
      if (attachment != null) {
        MetaValue metaValue = value;
        InstanceClassFactory icf = getMOFactory().getInstanceClassFactory(attachment.getClass());
        BeanInfo beanInfo = propertyInfo.getBeanInfo();
        icf.setValue(beanInfo, this, attachment, metaValue);
      }
    }
View Full Code Here

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

          .getProperty("visible").getValue()).getValue().toString();
      String type = ((EnumValueSupport) managedObject.getProperty(
          "modelType").getValue()).getValue().toString();

      // Get any model errors/warnings
      MetaValue errors = managedObject.getProperty("errors").getValue();
      if (errors != null) {
        CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
        MetaValue[] errorArray = errorValueSupport.getElements();

        for (MetaValue error : errorArray) {
View Full Code Here

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

        // This should never happen, but don't let it blow us up.
        LOG.error("ManagedProperty '" + propName //$NON-NLS-1$
            + "' has a null value in the ManagedProperties Map."); //$NON-NLS-1$
        continue;
      }
      MetaValue metaValue = managedProperty.getValue();
      if (managedProperty.isRemoved() || metaValue == null) {
        // Don't even add a Property to the Configuration if the
        // ManagedProperty is flagged as removed or has a
        // null value.
        continue;
      }
      PropertySimple customProp = customProps.get(propName);
      PropertyAdapter<Property, PropertyDefinition> propertyAdapter = PropertyAdapterFactory
          .getCustomPropertyAdapter(customProp);
      if (propertyAdapter == null)
        propertyAdapter = PropertyAdapterFactory
            .getPropertyAdapter(metaValue);
      if (propertyAdapter == null) {
        LOG
            .error("Unable to find a PropertyAdapter for ManagedProperty '" //$NON-NLS-1$
                + propName
                + "' with MetaType [" //$NON-NLS-1$
                + metaValue.getMetaType()
                + "] for ResourceType '" //$NON-NLS-1$
                + resourceType.getName() + "'."); //$NON-NLS-1$
        continue;
      }
      Property property = propertyAdapter.convertToProperty(metaValue,
View Full Code Here

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

    // If the ManagedProperty defines a default value, assume it's more
    // definitive than any default value that may
    // have been defined in the plugin descriptor, and update the
    // PropertyDefinition to use that as its default
    // value.
    MetaValue defaultValue = managedProperty.getDefaultValue();
    if (defaultValue != null) {
      updateDefaultValueOnPropertyDefinition(propertyDefinition,defaultValue);
    }
    MetaValue metaValue = managedProperty.getValue();
    PropertyAdapter propertyAdapter = null;
    if (metaValue != null) {
      LOG.trace("Populating existing MetaValue of type " //$NON-NLS-1$
          + metaValue.getMetaType() + " from Teiid property " //$NON-NLS-1$
          + propertyDefinition.getName() + " with definition " //$NON-NLS-1$
          + propertyDefinition + "..."); //$NON-NLS-1$
      propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(metaValue);

      propertyAdapter.populateMetaValueFromProperty(configuration.getSimple(propertyDefinition.getName()), metaValue, propertyDefinition);
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.