Class PluginDefinition


  • public class PluginDefinition
    extends Object
    Definition of a Plugin. There are three distinct types of plugins supported: - Finite - implementation is via providing a subclass of LogicalTypeFinite (or a child thereof, e.g. LogicalTypeFiniteSimple) - Infinite - implementation is via providing a subclass of LogicalTypeInfinite (or a child thereof) - RegExp - implementation is based on the detection of the supplied RegExp with a provided set of constraints.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      String backout  
      FTAType baseType
      The underlying base type (e.g.
      String clazz
      Infinite/Finite plugins: this is the class used to implement.
      String content
      Simple finite plugins: the content with the set of valid elements.
      String contentType
      ContentType describes the supplied content and must be one of 'inline', 'file' or 'resource'.
      String description
      English language description of the Semantic Type.
      Set<String> invalidList
      RegExp plugins: a set of strings that match the regExp but are known to be invalid.
      boolean localeSensitive
      Is this plugin sensitive to the input locale?
      String maximum
      Maximum value to be considered as a valid instance of this type, e.g.
      String minimum
      Minimum value to be considered as a valid instance of this type, e.g.
      boolean minMaxPresent
      Need to see both the minimum and maximum values to declare success.
      int minSamples
      Minimum number of samples required to declare success.
      String pluginType
      Type of the plugin - can be 'java', 'list', or 'regex'
      int priority
      The relative priority of this plugin.
      static int PRIORITY_EXTERNAL
      Externally registered plugins can have a priority no lower than this.
      String qualifier
      Semantic Type of Plugin (Qualifier).
      String signature
      Signature (structure) - the MD5 Hash of the Qualifier and the Base Type.
      int threshold
      The required threshold to be matched (can be adjusted by presence of Hot Words.
      PluginLocaleEntry[] validLocales
      locales this plugin applies to - empty set, implies all locales.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        PluginDefinition()  
      protected PluginDefinition​(String qualifier, String clazz)  
        PluginDefinition​(String qualifier, String description, String[] invalidList, String content, String contentType, String backout, PluginLocaleEntry[] validLocales, boolean localeSensitive, int threshold, FTAType baseType)  
    • Field Detail

      • PRIORITY_EXTERNAL

        public static final int PRIORITY_EXTERNAL
        Externally registered plugins can have a priority no lower than this.
        See Also:
        Constant Field Values
      • qualifier

        public String qualifier
        Semantic Type of Plugin (Qualifier).
      • description

        public String description
        English language description of the Semantic Type.
      • pluginType

        public String pluginType
        Type of the plugin - can be 'java', 'list', or 'regex'
      • signature

        public String signature
        Signature (structure) - the MD5 Hash of the Qualifier and the Base Type.
      • validLocales

        public PluginLocaleEntry[] validLocales
        locales this plugin applies to - empty set, implies all locales. Can use just language instead of tag, e.g. "en" rather than "en_US".
      • localeSensitive

        public boolean localeSensitive
        Is this plugin sensitive to the input locale?
      • priority

        public int priority
        The relative priority of this plugin.
      • clazz

        public String clazz
        Infinite/Finite plugins: this is the class used to implement.
      • invalidList

        public Set<String> invalidList
        RegExp plugins: a set of strings that match the regExp but are known to be invalid.
      • content

        public String content
        Simple finite plugins: the content with the set of valid elements.
      • contentType

        public String contentType
        ContentType describes the supplied content and must be one of 'inline', 'file' or 'resource'.
      • backout

        public String backout
      • threshold

        public int threshold
        The required threshold to be matched (can be adjusted by presence of Hot Words.
      • baseType

        public FTAType baseType
        The underlying base type (e.g. STRING, DOUBLE, LONG, DATE, ...
      • minimum

        public String minimum
        Minimum value to be considered as a valid instance of this type, e.g. 1 if the Semantic type is Financial Quarter.
      • maximum

        public String maximum
        Maximum value to be considered as a valid instance of this type, e.g. 4 if the Semantic type is Financial Quarter.
      • minSamples

        public int minSamples
        Minimum number of samples required to declare success.
      • minMaxPresent

        public boolean minMaxPresent
        Need to see both the minimum and maximum values to declare success.
    • Constructor Detail

      • PluginDefinition

        public PluginDefinition()
      • PluginDefinition

        protected PluginDefinition​(String qualifier,
                                   String clazz)
      • PluginDefinition

        public PluginDefinition​(String qualifier,
                                String description,
                                String[] invalidList,
                                String content,
                                String contentType,
                                String backout,
                                PluginLocaleEntry[] validLocales,
                                boolean localeSensitive,
                                int threshold,
                                FTAType baseType)
    • Method Detail

      • findByQualifier

        public static PluginDefinition findByQualifier​(String qualifier)
        Retrieve the Plugin Definition associated with this Qualifier.
        Parameters:
        qualifier - The Qualifier for this Logical Type
        Returns:
        The Plugin Definition associated with the supplied Qualifier.
      • isRequiredHeaderMissing

        public boolean isRequiredHeaderMissing​(Locale locale,
                                               String streamName)
      • getLocaleEntry

        public PluginLocaleEntry getLocaleEntry​(Locale locale)
                                         throws FTAPluginException
        Throws:
        FTAPluginException
      • isLocaleSupported

        public boolean isLocaleSupported​(Locale locale)
                                  throws FTAPluginException
        Throws:
        FTAPluginException
      • getLocaleDescription

        public String getLocaleDescription()