Package org.jboss.metatype.api.values

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


       if (metaType.isSimple()) {
                SimpleValue simpleValue = (SimpleValue)mp.getValue();
                return expectedType.cast((simpleValue != null) ? simpleValue.getValue() : null);
       }
       else if (metaType.isEnum()) {
         EnumValue enumValue = (EnumValue)mp.getValue();
         return expectedType.cast((enumValue != null) ? enumValue.getValue() : null);
       }
       throw new IllegalArgumentException(prop+ " is not a simple type"); //$NON-NLS-1$
     }
     return null;
 
View Full Code Here


                    SimpleValue simpleValue = (SimpleValue)managedProp.getValue();
                    value = simpleValue.getValue();
                }
                else if (metaType.isEnum())
                {
                    EnumValue enumValue = (EnumValue)managedProp.getValue();
                    value = enumValue.getValue();
                }
                else
                {
                    log.error("Nested ManagedProperty's value [" + managedProp.getValue()
                            + "] is not a SimpleValue or EnumValue - unsupported!");
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

      if (metaType.isSimple()) {
        SimpleValue simpleValue = (SimpleValue) mp.getValue();
        return expectedType.cast((simpleValue != null) ? simpleValue
            .getValue() : null);
      } else if (metaType.isEnum()) {
        EnumValue enumValue = (EnumValue) mp.getValue();
        return expectedType.cast((enumValue != null) ? enumValue
            .getValue() : null);
      }
      throw new IllegalStateException(prop + " is not a simple type"); //$NON-NLS-1$
    }
    return null;
View Full Code Here

      if (metaType.isSimple()) {
        SimpleValue simpleValue = (SimpleValue) prop;
        return expectedType.cast((simpleValue != null) ? simpleValue
            .getValue() : null);
      } else if (metaType.isEnum()) {
        EnumValue enumValue = (EnumValue) prop;
        return expectedType.cast((enumValue != null) ? enumValue
            .getValue() : null);
      }
      throw new IllegalStateException(prop + " is not a simple type"); //$NON-NLS-1$
    }
    return null;
View Full Code Here

      if (metaType.isSimple()) {
        SimpleValue simpleValue = (SimpleValue) mp.getValue();
        return expectedType.cast((simpleValue != null) ? simpleValue
            .getValue() : null);
      } else if (metaType.isEnum()) {
        EnumValue enumValue = (EnumValue) mp.getValue();
        return expectedType.cast((enumValue != null) ? enumValue
            .getValue() : null);
      }
      throw new IllegalArgumentException(prop + " is not a simple type"); //$NON-NLS-1$
    }
    return null;
View Full Code Here

    if (metaType.isSimple()) {
      SimpleValue defaultSimpleValue = (SimpleValue) defaultValue;
      Serializable value = defaultSimpleValue.getValue();
      propertyDefinitionSimple.setDefaultValue((value != null) ? value.toString() : null);
    } else { // defaultValueMetaType.isEnum()
      EnumValue defaultEnumValue = (EnumValue) defaultValue;
      Serializable value = defaultEnumValue.getValue();
      propertyDefinitionSimple.setDefaultValue((value != null) ? value.toString() : null);
    }
  }
View Full Code Here

        Serializable value;
        if (metaType.isSimple()) {
            SimpleValue simpleValue = (SimpleValue) property.getValue();
            value = (simpleValue != null) ? simpleValue.getValue() : null;
        } else if (metaType.isEnum()) {
            EnumValue enumValue = (EnumValue) property.getValue();
            value = (enumValue != null) ? enumValue.getValue() : null;
        } else {
            throw new IllegalStateException("Type of [" + property + "] is not simple or enum.");
        }
        return value;
    }
View Full Code Here

        Object value;
        if (metaValue.getMetaType().isSimple()) {
            SimpleValue simpleValue = (SimpleValue) metaValue;
            value = simpleValue.getValue();
        } else if (metaValue.getMetaType().isEnum()) {
            EnumValue enumValue = (EnumValue) metaValue;
            value = enumValue.getValue();
        } else if (metaValue.getMetaType().isArray()) {
            ArrayValue arrayValue = (ArrayValue) metaValue;
            value = arrayValue.getValue();
        } else if (metaValue.getMetaType().isCollection()) {
            CollectionValue collectionValue = (CollectionValue) metaValue;
View Full Code Here

                Object value;
                if (metaType.isSimple()) {
                    SimpleValue simpleValue = (SimpleValue) managedProp.getValue();
                    value = simpleValue.getValue();
                } else if (metaType.isEnum()) {
                    EnumValue enumValue = (EnumValue) managedProp.getValue();
                    value = enumValue.getValue();
                } else {
                    log.error("Nested ManagedProperty's value [" + managedProp.getValue()
                        + "] is not a SimpleValue or EnumValue - unsupported!");
                    continue;
                }
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.