Annotation Interface ConfigurationParameter


@Retention(RUNTIME) @Target(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:
  • Optional Element Summary

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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Tells the ConfigurationParameterFactory that no default value has been provided
    static final String
    the default value for name if none is given.
  • Field Details

    • USE_FIELD_NAME

      static final String USE_FIELD_NAME
      the default value for name if none is given.
      See Also:
    • NO_DEFAULT_VALUE

      static final String NO_DEFAULT_VALUE
      Tells the ConfigurationParameterFactory that no default value has been provided
      See Also:
  • Element Details

    • name

      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

      String description
      A description for the configuration parameter
      Returns:
      the description.
      Default:
      ""
    • mandatory

      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

      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"}