public String[] getEnumArrayValue() { if (value != null && isEnumArray()) { return EnumUtils.getNames((Enum<?>[]) value); } return null; }
public String[] getEnumArrayValue() { if (value != null && isEnumArray()) { return EnumUtils.getNames((Enum<?>[]) value); } return null; }
public List<SelectItem> getEnumArrayItems() { List<SelectItem> items = new ArrayList<SelectItem>(); String[] values = null; String[] displayValues = null; if (isEnumType() || isEnumArray()) { Class<?> instanceClass = type.getComponentType() != null ? type.getComponentType() : type; values = EnumUtils.getNames(instanceClass); displayValues = EnumUtils.getValues(instanceClass); } if(values != null) { for (int i = 0; i < values.length; i++) { items.add(new SelectItem(values[i], displayValues[i])); } } return items; }
public List<SelectItem> getEnumArrayItems() { List<SelectItem> items = new ArrayList<SelectItem>(); String[] values = null; String[] displayValues = null; if (isEnumType() || isEnumArray()) { Class<?> instanceClass = type.getComponentType() != null ? type.getComponentType() : type; values = EnumUtils.getNames(instanceClass); displayValues = EnumUtils.getValues(instanceClass); } if(values != null) { for (int i = 0; i < values.length; i++) { items.add(new SelectItem(values[i], displayValues[i])); } } return items; }
public boolean isChanged() throws Exception { if (propertyRows == null) { return false; } ITableProperties props = getTable().getProperties(); for (PropertyRow row : propertyRows) { if (row.getType().equals(PropertyRowType.PROPERTY)) { TableProperty property = (TableProperty) row.getData(); String name = property.getName(); Object newValue = property.getValue(); Object oldValue = props.getPropertyValue(name); boolean enumArray = property.isEnumArray(); if ((enumArray && !Arrays.equals((Enum<?>[]) oldValue, (Enum<?>[]) newValue)) || (!enumArray && ObjectUtils.notEqual(oldValue, newValue)) || (!props.getAllProperties().containsKey(name))) { return true; } } } for (String propToRemove : propsToRemove) { if (props.getAllProperties().containsKey(propToRemove)) return true; } return false; }
public boolean isChanged() throws Exception { if (propertyRows == null) { return false; } ITableProperties props = getTable().getProperties(); for (PropertyRow row : propertyRows) { if (row.getType().equals(PropertyRowType.PROPERTY)) { TableProperty property = (TableProperty) row.getData(); String name = property.getName(); Object newValue = property.getValue(); Object oldValue = props.getPropertyValue(name); boolean enumArray = property.isEnumArray(); if ((enumArray && !Arrays.equals((Enum<?>[]) oldValue, (Enum<?>[]) newValue)) || (!enumArray && ObjectUtils.notEqual(oldValue, newValue)) || (!props.getAllProperties().containsKey(name))) { return true; } } } for (String propToRemove : propsToRemove) { if (props.getAllProperties().containsKey(propToRemove)) return true; } return false; }
Object newValue = property.getValue(); Object oldValue = props.getPropertyValue(name); boolean enumArray = property.isEnumArray(); boolean stringArray = property.isStringArray();
Object newValue = property.getValue(); Object oldValue = props.getPropertyValue(name); boolean enumArray = property.isEnumArray(); boolean stringArray = property.isStringArray();