LongMultiProperty.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 Long property values within an upper and lower boundary.
08  * 
09  * @author Brian Remedios
10  */
11 public class LongMultiProperty extends AbstractMultiNumericProperty<Long[]> {
12 
13   /**
14    * Constructor for LongProperty.
15    * @param theName String
16    * @param theDescription String
17    * @param min Long
18    * @param max Long
19    * @param theDefaults Long[]
20    * @param theUIOrder float
21    * @throws IllegalArgumentException
22    */
23   public LongMultiProperty(String theName, String theDescription, Long min, Long max, Long[] theDefaults, float theUIOrder) {
24     super(theName, theDescription, min, max, theDefaults, theUIOrder);
25   }
26   
27   /**
28    * @return Class
29    * @see net.sourceforge.pmd.PropertyDescriptor#type()
30    */
31   public Class<Long[]> type() {
32     return Long[].class;
33   }
34   
35   /**
36    * @param value String
37    * @return Object
38    */
39   protected Object createFrom(String value) {
40     return Long.valueOf(value);
41   }
42 
43   /**
44    * Returns an array of the correct type for the receiver.
45    * 
46    * @param size int
47    * @return Object[]
48    */
49   protected Object[] arrayFor(int size) {
50     return new Long[size];
51   }
52 }