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 /**
08 * Defines a datatype that supports single String values.
09 *
10 * @author Brian Remedios
11 */
12 public class StringProperty extends AbstractProperty<String> {
13 /**
14 * Constructor for StringProperty.
15 * @param theName String
16 * @param theDescription String
17 * @param theDefaultValue String
18 * @param theUIOrder float
19 */
20 public StringProperty(String theName, String theDescription, String theDefaultValue, float theUIOrder) {
21 super(theName, theDescription, theDefaultValue, theUIOrder);
22 }
23
24 /**
25 * @return String
26 */
27 protected String defaultAsString() {
28 return defaultValue();
29 }
30
31 /**
32 *
33 * @return Class
34 * @see net.sourceforge.pmd.PropertyDescriptor#type()
35 */
36 public Class<String> type() {
37 return String.class;
38 }
39
40 /**
41 *
42 * @param valueString String
43 * @return Object
44 * @see net.sourceforge.pmd.PropertyDescriptor#valueFrom(String)
45 */
46 public String valueFrom(String valueString) {
47 return valueString;
48 }
49 }
|