IntegerMultiProperty.java
01 /**
02  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03  */
04 package net.sourceforge.pmd.lang.rule.properties;
05 
06 /**
07  * Defines a datatype that supports multiple Integer property values within an upper and lower boundary.
08  * 
09  * @author Brian Remedios
10  */
11 public class IntegerMultiProperty extends AbstractMultiNumericProperty<Integer[]> {
12   /**
13    * Constructor for IntegerProperty.
14    * @param theName String
15    * @param theDescription String
16    * @param min Integer
17    * @param max Integer
18    * @param theDefaults Integer[]
19    * @param theUIOrder float
20    * @throws IllegalArgumentException
21    */
22   public IntegerMultiProperty(String theName, String theDescription, Integer min, Integer max, Integer[] theDefaults, float theUIOrder) {
23     super(theName, theDescription, min, max, theDefaults, theUIOrder);
24   }
25   
26   /**
27    * @return Class
28    * @see net.sourceforge.pmd.PropertyDescriptor#type()
29    */
30   public Class<Integer[]> type() {
31     return Integer[].class;
32   }
33   
34   /**
35    * @param value String
36    * @return Object
37    */
38   protected Object createFrom(String value) {
39     return Integer.valueOf(value);
40   }
41 
42   /**
43    * @param size int
44    * @return Object[]
45    */
46   protected Object[] arrayFor(int size) {
47     return new Integer[size];
48   }
49 }