Examples of LabeledEnum


Examples of br.net.woodstock.rockframework.domain.util.LabeledEnum

    Enum[] array = EnumUtils.getEnumValues(clazz);
    for (Enum tmp : array) {
      String value = tmp.name();
      String label = null;
      if (tmp instanceof LabeledEnum) {
        LabeledEnum le = (LabeledEnum) tmp;
        label = le.getLabel();
      } else {
        label = tmp.name();
      }
      list.add(new SelectItem(value, label));
    }
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

     *      org.springframework.enums.LabeledEnum)
     */
    public void setLabeledEnum(String key, LabeledEnum value) {
        Assert.notNull(key, "Key cannot be null");

        LabeledEnum old = getLabeledEnum(key);
        internalSet(key, enumToString(value));
        afterSet(key, old, value);
    }
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

        assertEquals( 0, propertyChangeListener.getCount() );
    }

    public final void testEnum() {
        String key = "enum-value";
        LabeledEnum defaultValue = null;
        LabeledEnum newValue = TestEnum.ENUM2;

        // default value
        assertEquals( defaultValue, settings.getLabeledEnum( key ) );
        assertEquals( defaultValue, settings.getDefaultLabeledEnum( key ) );
        assertTrue( settings.isDefault( key ) );
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

  private static boolean exhaustiveCompare(
      Object boundValue, Object candidate, PropertyEditor editor, Map convertedValueCache) {

    String candidateDisplayString = ValueFormatter.getDisplayString(candidate, editor, false);
    if (boundValue instanceof LabeledEnum) {
      LabeledEnum labeledEnum = (LabeledEnum) boundValue;
      String enumCodeAsString = ObjectUtils.getDisplayString(labeledEnum.getCode());
      if (enumCodeAsString.equals(candidateDisplayString)) {
        return true;
      }
      String enumLabelAsString = ObjectUtils.getDisplayString(labeledEnum.getLabel());
      if (enumLabelAsString.equals(candidateDisplayString)) {
        return true;
      }
    }
    else if (JdkVersion.isAtLeastJava15() && boundValue.getClass().isEnum()) {
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

  protected Object toObject(String string, Class targetClass) throws Exception {
    return labeledEnumResolver.getLabeledEnumByLabel(targetClass, string);
  }

  protected String toString(Object object) throws Exception {
    LabeledEnum labeledEnum = (LabeledEnum) object;
    return labeledEnum.getLabel();
  }
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

  private static boolean exhaustiveCompare(Object boundValue, Object candidate,
      PropertyEditor editor, Map<PropertyEditor, Object> convertedValueCache) {

    String candidateDisplayString = ValueFormatter.getDisplayString(candidate, editor, false);
    if (boundValue instanceof LabeledEnum) {
      LabeledEnum labeledEnum = (LabeledEnum) boundValue;
      String enumCodeAsString = ObjectUtils.getDisplayString(labeledEnum.getCode());
      if (enumCodeAsString.equals(candidateDisplayString)) {
        return true;
      }
      String enumLabelAsString = ObjectUtils.getDisplayString(labeledEnum.getLabel());
      if (enumLabelAsString.equals(candidateDisplayString)) {
        return true;
      }
    }
    else if (boundValue.getClass().isEnum()) {
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

  private static boolean exhaustiveCompare(
      Object boundValue, Object candidate, PropertyEditor editor, Map convertedValueCache) {

    String candidateDisplayString = ValueFormatter.getDisplayString(candidate, editor, false);
    if (boundValue instanceof LabeledEnum) {
      LabeledEnum labeledEnum = (LabeledEnum) boundValue;
      String enumCodeAsString = ObjectUtils.getDisplayString(labeledEnum.getCode());
      if (enumCodeAsString.equals(candidateDisplayString)) {
        return true;
      }
      String enumLabelAsString = ObjectUtils.getDisplayString(labeledEnum.getLabel());
      if (enumLabelAsString.equals(candidateDisplayString)) {
        return true;
      }
    }
    else if (JdkVersion.isAtLeastJava15() && boundValue.getClass().isEnum()) {
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

  private static boolean exhaustiveCompare(
      Object boundValue, Object candidate, PropertyEditor propertyEditor, Map convertedValueCache) {

    String candidateDisplayString = ValueFormatter.getDisplayString(candidate, propertyEditor, false);
    if (boundValue instanceof LabeledEnum) {
      LabeledEnum labeledEnum = (LabeledEnum) boundValue;
      String enumCodeAsString = ObjectUtils.getDisplayString(labeledEnum.getCode());
      if (enumCodeAsString.equals(candidateDisplayString)) {
        return true;
      }
      String enumLabelAsString = ObjectUtils.getDisplayString(labeledEnum.getLabel());
      if (enumLabelAsString.equals(candidateDisplayString)) {
        return true;
      }
    }
    else if (JdkVersion.isAtLeastJava15() && boundValue.getClass().isEnum()) {
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

     *      org.springframework.enums.LabeledEnum)
     */
    public void setLabeledEnum( String key, LabeledEnum value ) {
        Assert.notNull( key, "Key cannot be null" );

        LabeledEnum old = getLabeledEnum( key );
        internalSet( key, enumToString( value ) );
        afterSet( key, old, value );
    }
View Full Code Here

Examples of org.springframework.core.enums.LabeledEnum

  private static boolean exhaustiveCompare(Object boundValue, Object candidate,
      PropertyEditor editor, Map<PropertyEditor, Object> convertedValueCache) {

    String candidateDisplayString = ValueFormatter.getDisplayString(candidate, editor, false);
    if (boundValue instanceof LabeledEnum) {
      LabeledEnum labeledEnum = (LabeledEnum) boundValue;
      String enumCodeAsString = ObjectUtils.getDisplayString(labeledEnum.getCode());
      if (enumCodeAsString.equals(candidateDisplayString)) {
        return true;
      }
      String enumLabelAsString = ObjectUtils.getDisplayString(labeledEnum.getLabel());
      if (enumLabelAsString.equals(candidateDisplayString)) {
        return true;
      }
    }
    else if (boundValue.getClass().isEnum()) {
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.