net.sourceforge.pmd.lang.rule.properties

## Class MethodMultiProperty

- java.lang.Object
- - net.sourceforge.pmd.lang.rule.properties.AbstractProperty<T>
  - - net.sourceforge.pmd.lang.rule.properties.AbstractPackagedProperty<T>
    - - net.sourceforge.pmd.lang.rule.properties.AbstractMultiPackagedProperty<Method[]>
      - - net.sourceforge.pmd.lang.rule.properties.MethodMultiProperty

- All Implemented Interfaces:
    Comparable<PropertyDescriptor<?>>, PropertyDescriptor<Method[]>

      public class MethodMultiProperty
      extends AbstractMultiPackagedProperty<Method[]>

  Defines a property type that can specify multiple methods to use as part of a rule. Rule developers can limit the rules to those within designated packages per the 'legalPackages' argument in the constructor which can be an array of partial package names, i.e., ["java.lang", "com.mycompany" ].
  Author:
    Brian Remedios

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PropertyDescriptorFactory` | `FACTORY`

    - ### Fields inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractMultiPackagedProperty

      `DELIMITER`

    - ### Fields inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractPackagedProperty

      `packagedFieldTypesByKey`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MethodMultiProperty(String theName, String theDescription, Method[] theDefaults, String[] legalPackageNames, float theUIOrder)` Constructor for MethodProperty.
    `MethodMultiProperty(String theName, String theDescription, String methodDefaults, Map<String,String> otherParams, float theUIOrder)` Constructor for MethodProperty.
    `MethodMultiProperty(String theName, String theDescription, String methodDefaults, String[] legalPackageNames, float theUIOrder)` Constructor for MethodProperty.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `asString(Object value)` Return the value as a string that can be easily recognized and parsed when we see it again.
    `protected String` | `itemTypeName()` Method itemTypeName.
    `static Method[]` | `methodsFrom(String methodsStr)`
    `protected String` | `packageNameOf(Object item)`
    `Class<Method[]>` | `type()` Denotes the value datatype.
    `Method[]` | `valueFrom(String valueString)` If the property is multi-valued then return the separate values after parsing the propertyString provided.

    - ### Methods inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractMultiPackagedProperty

      `defaultAsString, isMultiValue`

    - ### Methods inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractPackagedProperty

      `addAttributesTo, legalPackageNames, packageNamesIn, valueErrorFor`

    - ### Methods inherited from class net.sourceforge.pmd.lang.rule.properties.AbstractProperty

      `areEqual, asDelimitedString, asDelimitedString, attributeValuesById, choices, compareTo, defaultHasNullValue, defaultValue, description, equals, errorFor, hashCode, isArray, isRequired, multiValueDelimiter, name, preferredRowCount, propertyErrorFor, toString, typeErrorFor, uiOrder, valuesErrorFor`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### FACTORY

          public static final PropertyDescriptorFactory FACTORY

  - ### Constructor Detail

    - #### MethodMultiProperty

          public MethodMultiProperty(String theName,
                             String theDescription,
                             Method[] theDefaults,
                             String[] legalPackageNames,
                             float theUIOrder)

      Constructor for MethodProperty.
      Parameters:
        `theName` - String
        `theDescription` - String
        `theDefaults` - Method[]
        `legalPackageNames` - String[]
        `theUIOrder` - float
      Throws:
        `IllegalArgumentException`

    - #### MethodMultiProperty

          public MethodMultiProperty(String theName,
                             String theDescription,
                             String methodDefaults,
                             String[] legalPackageNames,
                             float theUIOrder)

      Constructor for MethodProperty.
      Parameters:
        `theName` - String
        `theDescription` - String
        `methodDefaults` - String
        `legalPackageNames` - String[]
        `theUIOrder` - float
      Throws:
        `IllegalArgumentException`

    - #### MethodMultiProperty

          public MethodMultiProperty(String theName,
                             String theDescription,
                             String methodDefaults,
                             Map<String,String> otherParams,
                             float theUIOrder)

      Constructor for MethodProperty.
      Parameters:
        `theName` - String
        `theDescription` - String
        `methodDefaults` - String
        `otherParams` - Map
        `theUIOrder` - float
      Throws:
        `IllegalArgumentException`

  - ### Method Detail

    - #### methodsFrom

          public static Method[] methodsFrom(String methodsStr)

      Parameters:
        `methodsStr` - String
      Returns:
        Method[]

    - #### asString

          protected String asString(Object value)

      Return the value as a string that can be easily recognized and parsed when we see it again.
      Overrides:
        `asString` in class `AbstractProperty<Method[]>`
      Parameters:
        `value` - Object
      Returns:
        String

    - #### packageNameOf

          protected String packageNameOf(Object item)

      Specified by:
        `packageNameOf` in class `AbstractPackagedProperty<Method[]>`
      Parameters:
        `item` - Object
      Returns:
        String

    - #### itemTypeName

          protected String itemTypeName()

      Description copied from class: `AbstractPackagedProperty`
      Method itemTypeName.
      Specified by:
        `itemTypeName` in class `AbstractPackagedProperty<Method[]>`
      Returns:
        String

    - #### type

          public Class<Method[]> type()

      Description copied from interface: `PropertyDescriptor`
      Denotes the value datatype.
      Returns:
        Class
      See Also:
        `PropertyDescriptor.type()`

    - #### valueFrom

          public Method[] valueFrom(String valueString)
                             throws IllegalArgumentException

      Description copied from interface: `PropertyDescriptor`
      If the property is multi-valued then return the separate values after parsing the propertyString provided. If it isn't a multi-valued property then the value will be returned within an array of size[1].
      Parameters:
        `valueString` - String
      Returns:
        Object
      Throws:
        `IllegalArgumentException`
      See Also:
        `PropertyDescriptor.valueFrom(String)`

Copyright © 2002-2013 InfoEther. All Rights Reserved.