Package org.jboss.metatype.api.values

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


        return enumValue;
    }

    protected void setInnerValue(String propSimpleValue, MetaValue metaValue, PropertyDefinitionSimple propDefSimple)
    {
        EnumValueSupport enumValueSupport = (EnumValueSupport)metaValue;
        enumValueSupport.setValue(propSimpleValue);
    }
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

      ManagedProperty state = props.get("state");
      assertNotNull("state", state);
      EnumMetaType stateType = (EnumMetaType) state.getMetaType();
      EnumValue stateValue = (EnumValue) state.getValue();
      getLog().info("state: "+stateValue);
      EnumValue installed = new EnumValueSupport(stateType, "Installed");
      assertEquals(installed, stateValue);
   }
View Full Code Here

         if(deploymentType == null)
            deploymentType = SecurityDeploymentType.NONE;
        
         // Set domain and deployment type
         securityDomain.set(DOMAIN, SimpleValueSupport.wrap(object.getDomain()));
         securityDomain.set(DeploymentTypeName, new EnumValueSupport(enumMetaType, deploymentType));
         //
         return securityDomain;
      }
      throw new IllegalArgumentException("Cannot convert securityDomain " + object);
   }
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

    * @throws Exception for any problem
    */
   public void testEnumFromString() throws Exception
   {
      EnumMetaType enumType = assertInstanceOf(resolve(TestEnum.class), EnumMetaType.class);
      EnumValue expected = new EnumValueSupport(enumType, TestEnum.ONE.name());

      MetaValue result = createMetaValue(TestEnum.ONE);
      EnumValue actual = assertInstanceOf(result, EnumValue.class);
     
      getLog().debug("Enum Value: " + actual);
View Full Code Here

      assertEquals(expected, actual);
   }
   public void testEnum() throws Exception
   {
      EnumMetaType enumType = assertInstanceOf(resolve(TestEnum.class), EnumMetaType.class);
      EnumValue expected = new EnumValueSupport(enumType, TestEnum.ONE);

      MetaValue result = createMetaValue(TestEnum.ONE);
      EnumValue actual = assertInstanceOf(result, EnumValue.class);
     
      getLog().debug("Enum Value: " + actual);
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

    * @param value the enum value
    * @return a enum value
    */
   protected EnumValue createEnumValue(PersistedEnumValue enumElement, EnumMetaType type)
   {
      return new EnumValueSupport(type, enumElement.getValue());
   }
View Full Code Here

      ControllerContext context = controller.getContext(name, null);
      if (context == null)
         throw new IllegalStateException("Context not installed: " + name);

      ControllerState state = context.getState();
      return new EnumValueSupport(ControllerStateMetaType.TYPE, state.getStateString());
   }
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.