1 package net.sourceforge.pmd.properties; 2 3 4 10 public class BooleanProperty extends AbstractScalarProperty { 11 12 19 public BooleanProperty(String theName, String theDescription, boolean defaultValue, float theUIOrder) { 20 super(theName, theDescription, Boolean.valueOf(defaultValue), theUIOrder); 21 } 22 23 31 public BooleanProperty(String theName, String theDescription, boolean[] defaultValues, float theUIOrder, int theMaxValues) { 32 this(theName, theDescription, asBooleans(defaultValues), theUIOrder, theMaxValues); 33 34 } 35 36 44 public BooleanProperty(String theName, String theDescription, Boolean [] defaultValues, float theUIOrder, int theMaxValues) { 45 super(theName, theDescription, defaultValues, theUIOrder); 46 47 maxValueCount(theMaxValues); 48 } 49 50 55 private static final Boolean [] asBooleans(boolean[] bools) { 56 Boolean [] booleans = new Boolean [bools.length]; 57 for (int i=0; i<bools.length; i++) booleans[i] = Boolean.valueOf(bools[i]); 58 return booleans; 59 } 60 61 66 public Class type() { 67 return Boolean .class; 68 } 69 70 75 protected Object createFrom(String value) { 76 return Boolean.valueOf(value); 77 } 78 79 84 protected Object [] arrayFor(int size) { 85 return new Boolean [size]; 86 } 87 } 88 | Popular Tags |