org.apache.uima.fit.descriptor

## Annotation Type ConfigurationParameter

-     @Retention(value=RUNTIME)
       @Target(value=FIELD)
      public @interface ConfigurationParameter

  This annotation marks an analysis component member variable as a configuration parameter. The types of member variables that can use this annotation are:
  - primitive types and arrays: `boolean`, `boolean[]`, `int`, `int[]`, `float`, `float[]`
  - primitive object wrapper types and arrays: `Boolean`, `Boolean``[]`, `Integer`, `Integer``[]`, `Float`, `Float``[]`
  - strings and string arrays: `String`, `String``[]`
  - enumeration types (`Enum`)
  - language/locale: `Locale`
  - regular expression patterns: `Pattern`
  - all other types that have a constructor that takes a string as the single argument, e.g.: `File`, `URL`, `URI` ...
  See Also:
    `ConfigurationParameterInitializer`

- - ### Field Summary

    Fields
    Modifier and Type | Fields and Description
    --- | ---
    `static String` | `NO_DEFAULT_VALUE` Tells the ConfigurationParameterFactory that no default value has been provided
    `static String` | `USE_FIELD_NAME` the default value for name if none is given.

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `String[]` | `defaultValue` What can be the value should correspond with the type of the field that is annotated.
    `String` | `description` A description for the configuration parameter
    `boolean` | `mandatory` Specifies whether this configuration parameter is mandatory - i.e.
    `String` | `name` If you do not specify a name then the default name will be given by `USE_FIELD_NAME` will be the default name.

- - ### Field Detail

    - #### USE_FIELD_NAME

          public static final String USE_FIELD_NAME

      the default value for name if none is given.

  - - #### NO_DEFAULT_VALUE

          public static final String NO_DEFAULT_VALUE

      Tells the ConfigurationParameterFactory that no default value has been provided

  - ### Element Detail

    - #### name

          public abstract String name

      If you do not specify a name then the default name will be given by `USE_FIELD_NAME` will be the default name. This tells ConfigurationParameterFactory to use the name of the annotated field as the name of the configuration parameter. The exact name that is used is determined by the method `ConfigurationParameterFactory.getConfigurationParameterName(java.lang.reflect.Field)`
      Returns:
        the parameter name.
      Default:
        "org.apache.uima.fit.descriptor.ConfigurationParameter.USE_FIELD_NAME"

  - - #### description

          public abstract String description

      A description for the configuration parameter
      Returns:
        the description.
      Default:
        ""

  - - #### mandatory

          public abstract boolean mandatory

      Specifies whether this configuration parameter is mandatory - i.e. the value must be provided
      Returns:
        whether this configuration parameter is mandatory.
      Default:
        true

  - - #### defaultValue

          public abstract String[] defaultValue

      What can be the value should correspond with the type of the field that is annotated. If for example, the field is a String, then the default value can be any string - e.g. "asdf". If the field is a boolean, then the default value can be "true" for true or any other string for false. If the field is an integer, then the default value can be any string that Integer.parseInt() can successfully parse. Remember that just because the default value is a string here that you should give an actual integer (not an integer parseable string) value when setting the parameter via e.g. AnalysisEngineFactory.createPrimitiveDescription(). If the field is a float, then the default value can be any string that Float.parseFloat() can successfully parse. Remember that just because the default value is a string here that you should give an actual float value (not a float parseable string) when setting the parameter via e.g. AnalysisEngineFactory.createPrimitiveDescription().

      If the field is multiValued, then the value should look something like this '{"value1", "value2"}'

      If you want a field to be initialized with a null value, then do not specify a default value or specify the value given by the field `NO_DEFAULT_VALUE`

      Returns:
        the default value.
      Default:
        "org.apache.uima.fit.descriptor.ConfigurationParameter.NO_DEFAULT_VALUE"

Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.