Package org.jboss.metatype.api.values

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


       }
     }
  }
 
  public static EnumValue wrap(EnumMetaType type, String value) {
    return new EnumValueSupport(type, value);
  }
View Full Code Here


        propSimple.setValue(value);
    }

    public MetaValue convertToMetaValue(PropertySimple propSimple, PropertyDefinitionSimple propDefSimple, MetaType metaType)
    {
        EnumValue enumValue = new EnumValueSupport((EnumMetaType)metaType, propSimple.getStringValue());
        populateMetaValueFromProperty(propSimple, enumValue, propDefSimple);
        return enumValue;
    }
View Full Code Here

        return enumValue;
    }

    protected void setInnerValue(String propSimpleValue, MetaValue metaValue, PropertyDefinitionSimple propDefSimple)
    {
        EnumValueSupport enumValueSupport = (EnumValueSupport)metaValue;
        enumValueSupport.setValue(propSimpleValue);
    }
View Full Code Here

      request.set(COMMAND, SimpleValueSupport.wrap(object.getCommand()));
      request.set(SOURCE_REQUEST, SimpleValueSupport.wrap(object.sourceRequest()));
      request.set(NODE_ID, SimpleValueSupport.wrap(object.getNodeId()));
      request.set(TRANSACTION_ID,SimpleValueSupport.wrap(object.getTransactionId()));
      EnumMetaType emt = (EnumMetaType)composite.getType(STATE);
      request.set(STATE, new EnumValueSupport(emt, object.getState()));
      request.set(THREAD_STATE, new EnumValueSupport((EnumMetaType)composite.getType(THREAD_STATE), object.getThreadState()));
      return request;
    }
    throw new IllegalArgumentException("Cannot convert RequestMetadata " + object); //$NON-NLS-1$
  }
View Full Code Here

      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

   public static <T extends Enum<?>> EnumValue createEnumValue(EnumMetaType type, T value)
   {
      if (value == null)
         return null;

      return new EnumValueSupport(type, value.name());
   }
View Full Code Here

   public static <T extends Enum<?>> EnumValue createEnumValue(EnumMetaType type, T value)
   {
      if (value == null)
         return null;

      return new EnumValueSupport(type, value.name());
   }
View Full Code Here

      ManagedProperty prop = AbstractRuntimeComponentDispatcher.getActiveProperty();
     
      if(propertyName.equals("state") && prop.getMetaType().equals(ControllerStateMetaType.TYPE))
      {
         String stateString = getState(componentName);
         EnumValueSupport state = new EnumValueSupport(ControllerStateMetaType.TYPE, stateString);
         return state;
      }
     
      try
      {
View Full Code Here

      catch (Throwable t)
      {
         if(propertyName.equals("state") && prop.getMetaType().equals(ControllerStateMetaType.TYPE))
         {
            String stateString = getState(componentName);
            EnumValueSupport state = new EnumValueSupport(ControllerStateMetaType.TYPE, stateString);
            return state;
         }
         else
         {
            throw new UndeclaredThrowableException(t, "Failed to get property '" + propertyName + "' on component '" + componentName + "'.");
View Full Code Here

        propSimple.setValue(value);
    }

    public MetaValue convertToMetaValue(PropertySimple propSimple, PropertyDefinitionSimple propDefSimple, MetaType metaType)
    {
        EnumValue enumValue = new EnumValueSupport((EnumMetaType)metaType, propSimple.getStringValue());
        populateMetaValueFromProperty(propSimple, enumValue, propDefSimple);
        return enumValue;
    }
View Full Code Here

TOP

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

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.