net.sourceforge.pmd.lang.rule.properties.factories
Class BasicPropertyDescriptorFactory<T>

java.lang.Object
  extended by net.sourceforge.pmd.lang.rule.properties.factories.BasicPropertyDescriptorFactory<T>
Type Parameters:
T -
All Implemented Interfaces:
PropertyDescriptorFactory

public class BasicPropertyDescriptorFactory<T>
extends Object
implements PropertyDescriptorFactory

Author:
Brian Remedios

Field Summary
protected static Map<String,Boolean> CORE_FIELD_TYPES_BY_KEY
           
 
Constructor Summary
BasicPropertyDescriptorFactory(Class<?> theValueType)
           
BasicPropertyDescriptorFactory(Class<?> theValueType, Map<String,Boolean> additionalFieldTypesByKey)
           
 
Method Summary
protected static Boolean[] booleanValuesIn(String booleanString, char delimiter)
           
protected static Character[] charsIn(String charString, char delimiter)
           
protected static Object[] choicesIn(Map<String,String> valuesById)
           
 PropertyDescriptor<?> createWith(Map<String,String> valuesById)
          Create a property descriptor of the appropriate type using the values provided.
protected  String defaultValueIn(Map<String,String> valuesById)
           
protected static char delimiterIn(Map<String,String> valuesById)
           
protected static char delimiterIn(Map<String,String> valuesById, char defaultDelimiter)
           
protected  String descriptionIn(Map<String,String> valuesById)
           
protected static Double[] doublesIn(String numberString, char delimiter)
           
 Map<String,Boolean> expectedFields()
          Denote the identifiers of the expected fields paired with booleans denoting whether they are required (non-null) or not.
static Map<String,Boolean> expectedFieldTypesWith(String[] otherKeys, Boolean[] otherValues)
           
protected static Float[] floatsIn(String numberString, char delimiter)
           
protected static int indexIn(Map<String,String> valuesById)
           
protected static int[] indiciesIn(Map<String,String> valuesById)
           
protected static Integer[] integersIn(String numberString, char delimiter)
           
protected static String[] labelsIn(Map<String,String> valuesById)
           
protected static String[] legalPackageNamesIn(Map<String,String> valuesById, char delimiter)
           
protected static Long[] longsIn(String numberString, char delimiter)
           
protected static String maxValueIn(Map<String,String> valuesById)
           
protected static String[] minMaxFrom(Map<String,String> valuesById)
           
protected static String minValueIn(Map<String,String> valuesById)
           
protected  String nameIn(Map<String,String> valuesById)
           
protected  String numericDefaultValueIn(Map<String,String> valuesById)
           
 Class<?> valueType()
          The type of the value of the PropertyDescriptor created by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_FIELD_TYPES_BY_KEY

protected static final Map<String,Boolean> CORE_FIELD_TYPES_BY_KEY
Constructor Detail

BasicPropertyDescriptorFactory

public BasicPropertyDescriptorFactory(Class<?> theValueType)

BasicPropertyDescriptorFactory

public BasicPropertyDescriptorFactory(Class<?> theValueType,
                                      Map<String,Boolean> additionalFieldTypesByKey)
Method Detail

valueType

public Class<?> valueType()
Description copied from interface: PropertyDescriptorFactory
The type of the value of the PropertyDescriptor created by this factory.

Specified by:
valueType in interface PropertyDescriptorFactory
Returns:
the type of the value.

createWith

public PropertyDescriptor<?> createWith(Map<String,String> valuesById)
Description copied from interface: PropertyDescriptorFactory
Create a property descriptor of the appropriate type using the values provided.

Specified by:
createWith in interface PropertyDescriptorFactory
Parameters:
valuesById - the map of values
Returns:
a new and initialized PropertyDescriptor

expectedFields

public Map<String,Boolean> expectedFields()
Description copied from interface: PropertyDescriptorFactory
Denote the identifiers of the expected fields paired with booleans denoting whether they are required (non-null) or not.

Specified by:
expectedFields in interface PropertyDescriptorFactory
Returns:
Map

nameIn

protected String nameIn(Map<String,String> valuesById)

descriptionIn

protected String descriptionIn(Map<String,String> valuesById)

defaultValueIn

protected String defaultValueIn(Map<String,String> valuesById)

numericDefaultValueIn

protected String numericDefaultValueIn(Map<String,String> valuesById)

minValueIn

protected static String minValueIn(Map<String,String> valuesById)

maxValueIn

protected static String maxValueIn(Map<String,String> valuesById)

booleanValuesIn

protected static Boolean[] booleanValuesIn(String booleanString,
                                           char delimiter)

charsIn

protected static Character[] charsIn(String charString,
                                     char delimiter)

integersIn

protected static Integer[] integersIn(String numberString,
                                      char delimiter)

longsIn

protected static Long[] longsIn(String numberString,
                                char delimiter)

floatsIn

protected static Float[] floatsIn(String numberString,
                                  char delimiter)

doublesIn

protected static Double[] doublesIn(String numberString,
                                    char delimiter)

labelsIn

protected static String[] labelsIn(Map<String,String> valuesById)

choicesIn

protected static Object[] choicesIn(Map<String,String> valuesById)

indexIn

protected static int indexIn(Map<String,String> valuesById)

indiciesIn

protected static int[] indiciesIn(Map<String,String> valuesById)

delimiterIn

protected static char delimiterIn(Map<String,String> valuesById)

delimiterIn

protected static char delimiterIn(Map<String,String> valuesById,
                                  char defaultDelimiter)

minMaxFrom

protected static String[] minMaxFrom(Map<String,String> valuesById)

legalPackageNamesIn

protected static String[] legalPackageNamesIn(Map<String,String> valuesById,
                                              char delimiter)

expectedFieldTypesWith

public static Map<String,Boolean> expectedFieldTypesWith(String[] otherKeys,
                                                         Boolean[] otherValues)


Copyright © 2002-2015 InfoEther. All Rights Reserved.