Package net.sourceforge.pmd.properties
Enum PropertyTypeId
- java.lang.Object
-
- java.lang.Enum<PropertyTypeId>
-
- net.sourceforge.pmd.properties.PropertyTypeId
-
- All Implemented Interfaces:
Serializable
,Comparable<PropertyTypeId>
public enum PropertyTypeId extends Enum<PropertyTypeId>
Enumerates the properties that can be built from the XML. Defining a property in the XML requires thetype
attribute, which acts as a mnemonic for the type of the property that should be built. The mapping between the values of this attribute and the concrete property that is built is encoded in the constants of this enum.Properties API changes
This class' API is mainly provided to build GUIs for XPath rules like the rule designer, so that they have info about the available properties from XML. As such, the number of clients are probably low. Nevertheless, a bunch of members have been deprecated to warn about probable upcoming API changes with 7.0.0, but the amount of change may be greater. SeePropertyDescriptor
for more info about property framework changes with 7.0.0.- Since:
- 6.0.0
- Author:
- Clément Fournier
- See Also:
PropertyDescriptorExternalBuilder
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
BOOLEAN_LIST
Deprecated.CHARACTER
CHARACTER_LIST
CLASS
Deprecated.CLASS_LIST
Deprecated.DOUBLE
DOUBLE_LIST
FLOAT
Deprecated.FLOAT_LIST
Deprecated.INTEGER
INTEGER_LIST
LONG
LONG_LIST
REGEX
STRING
STRING_LIST
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PropertyDescriptorExternalBuilder<?>
factoryFor(String stringId)
Deprecated.PropertyDescriptorExternalBuilder<?>
getFactory()
Deprecated.String
getStringId()
Gets the value of the type attribute represented by this constant.ValueParser<?>
getValueParser()
Deprecated.boolean
isPropertyMultivalue()
Deprecated.boolean
isPropertyNumeric()
Deprecated.boolean
isPropertyPackaged()
Deprecated.static PropertyTypeId
lookupMnemonic(String stringId)
Gets the enum constant corresponding to the given mnemonic.Class<?>
propertyValueType()
Deprecated.static String
typeIdFor(Class<?> valueType, boolean multiValue)
Deprecated.The signature will probably be altered in 7.0.0 but a similar functionality will be availablestatic Map<String,PropertyTypeId>
typeIdsToConstants()
Returns the full mappings from type ids to enum constants.static PropertyTypeId
valueOf(String name)
Returns the enum constant of this type with the specified name.static PropertyTypeId[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final PropertyTypeId BOOLEAN
-
BOOLEAN_LIST
@Deprecated public static final PropertyTypeId BOOLEAN_LIST
Deprecated.
-
STRING
public static final PropertyTypeId STRING
-
STRING_LIST
public static final PropertyTypeId STRING_LIST
-
CHARACTER
public static final PropertyTypeId CHARACTER
-
CHARACTER_LIST
public static final PropertyTypeId CHARACTER_LIST
-
REGEX
public static final PropertyTypeId REGEX
-
INTEGER
public static final PropertyTypeId INTEGER
-
INTEGER_LIST
public static final PropertyTypeId INTEGER_LIST
-
LONG
public static final PropertyTypeId LONG
-
LONG_LIST
public static final PropertyTypeId LONG_LIST
-
FLOAT
@Deprecated public static final PropertyTypeId FLOAT
Deprecated.
-
FLOAT_LIST
@Deprecated public static final PropertyTypeId FLOAT_LIST
Deprecated.
-
DOUBLE
public static final PropertyTypeId DOUBLE
-
DOUBLE_LIST
public static final PropertyTypeId DOUBLE_LIST
-
CLASS
@Deprecated public static final PropertyTypeId CLASS
Deprecated.
-
CLASS_LIST
@Deprecated public static final PropertyTypeId CLASS_LIST
Deprecated.
-
-
Method Detail
-
values
public static PropertyTypeId[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PropertyTypeId c : PropertyTypeId.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PropertyTypeId valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getStringId
public String getStringId()
Gets the value of the type attribute represented by this constant.- Returns:
- The string id
-
getFactory
@Deprecated public PropertyDescriptorExternalBuilder<?> getFactory()
Deprecated.Gets the factory associated to the type id, that can build the property from strings extracted from the XML.- Returns:
- The factory
-
isPropertyNumeric
@Deprecated public boolean isPropertyNumeric()
Deprecated.Returns true if the property corresponding to this factory is numeric, which means it can be safely cast to aNumericPropertyDescriptor
.- Returns:
- whether the property is numeric
-
isPropertyPackaged
@Deprecated public boolean isPropertyPackaged()
Deprecated.Returns true if the property corresponding to this factory is packaged, which means it can be safely cast to aPackagedPropertyDescriptor
.- Returns:
- whether the property is packaged
-
isPropertyMultivalue
@Deprecated public boolean isPropertyMultivalue()
Deprecated.Returns true if the property corresponding to this factory takes lists of values as its value.- Returns:
- whether the property is multivalue
-
propertyValueType
@Deprecated public Class<?> propertyValueType()
Deprecated.Returns the value type of the property corresponding to this factory. This is the component type of the list if the property is multivalued.- Returns:
- The value type of the property
-
getValueParser
@Deprecated public ValueParser<?> getValueParser()
Deprecated.Gets the object used to parse the values of this property from a string. If the property is multivalued, the parser only parses individual components of the list. A list parser can be obtained withValueParserConstants.multi(ValueParser, char)
.- Returns:
- The value parser
-
typeIdsToConstants
public static Map<String,PropertyTypeId> typeIdsToConstants()
Returns the full mappings from type ids to enum constants.- Returns:
- The full mapping.
-
factoryFor
@Deprecated public static PropertyDescriptorExternalBuilder<?> factoryFor(String stringId)
Deprecated.Gets the factory for the descriptor identified by the string id.- Parameters:
stringId
- The identifier of the type- Returns:
- The factory used to build new instances of a descriptor
-
lookupMnemonic
public static PropertyTypeId lookupMnemonic(String stringId)
Gets the enum constant corresponding to the given mnemonic.- Parameters:
stringId
- A mnemonic for the property type- Returns:
- A PropertyTypeId
-
typeIdFor
@Deprecated public static String typeIdFor(Class<?> valueType, boolean multiValue)
Deprecated.The signature will probably be altered in 7.0.0 but a similar functionality will be availableGets the string representation of this type, as it should be given when defining a descriptor in the xml.- Parameters:
valueType
- The type to look formultiValue
- Whether the descriptor is multivalued or not- Returns:
- The string id
-
-