Package org.jboss.metatype.api.values

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


        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


      // The bean state
      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

            openValue = cd;
         }
      }
      else if(mv instanceof EnumValue)
      {
         EnumValue ev = EnumValue.class.cast(mv);
         openValue = ev.getValue();
      }
      else
      {
         throw new OpenDataException("Unhandled MetaValue: "+mv);
      }
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);
      assertEquals(expected, 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);
      assertEquals(expected, actual);
   }
View Full Code Here

            return false;
         enumString = value.getValue().toString();
      }
      else
      {
         EnumValue value = EnumValue.class.cast(obj);
         enumString = value.getValue();
      }
      return validValues.contains(enumString);
   }
View Full Code Here

         ManagedObject mo = (ManagedObject) gv.getValue();
         // Create the correct type of
         ManagedProperty type = mo.getProperty("securityDeploymentType");
         ManagedProperty domain = mo.getProperty("domain");
         String domainName = ((SimpleValue) domain.getValue()).getValue().toString();
         EnumValue typeValue = (EnumValue) type.getValue();
         String typeString = typeValue.getValue();
         SecurityDeploymentType stype = SecurityDeploymentType.valueOf(typeString);
         SecDomainMD domainMD = null;
         switch(stype)
         {
         case APPLICATION:
View Full Code Here

                     newProps.put("alias", aliasesMP);
                  }
                  // Add a state property
                  DefaultFieldsImpl stateFields = getFields("state", ControllerStateMetaType.TYPE);
                  stateFields.setViewUse(new ViewUse[]{ViewUse.STATISTIC});
                  EnumValue stateValue = getState(bmd.getName(), kernel);
                  stateFields.setValue(stateValue);
                  stateFields.setDescription("The bean controller state");
                  ManagedPropertyImpl stateMP = new ManagedPropertyImpl(mmo, stateFields);
                  newProps.put("state", stateMP);
                  // Update the properties
View Full Code Here

TOP

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

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.