Interface Capability

  • All Superinterfaces:
    java.lang.Cloneable, MetaDataObject, java.io.Serializable, XMLizable
    All Known Implementing Classes:
    Capability_impl

    public interface Capability
    extends MetaDataObject
    A Capability defines an operation that an Resource can carry out. Each Capability consists of the following information:
    • The output types and features that the Resource can produce in the CAS
    • The input types and features that are required
    • The Sofa names of input Sofas that are required
    • The Sofa names of output Sofas that the resource can produce
    • Preconditions that must be satisfied in order for processing to begin. In a text analysis engine, the most common precondition is a check on the language of the document.
    As with all MetaDataObjects, a Capability may or may not be modifiable. An application can find out by calling the MetaDataObject.isModifiable() method.
    • Field Detail

      • EMPTY_CAPABILITIES

        static final Capability[] EMPTY_CAPABILITIES
    • Method Detail

      • getDescription

        java.lang.String getDescription()
        Gets the description of this Capability.
        Returns:
        the description of this Capability.
      • setDescription

        void setDescription​(java.lang.String aDescription)
        Sets the description of this Capability.
        Parameters:
        aDescription - aDescription the description of this Capability.
      • getInputs

        TypeOrFeature[] getInputs()
        Gets the inputs of this Capability.
        Returns:
        an array of references to Types or Features in this Resource's Type System.
      • getOutputs

        TypeOrFeature[] getOutputs()
        Gets the outputs of this Capability.
        Returns:
        an array of references to Types or Features in this Resource's TypeSystem.
      • getInputSofas

        java.lang.String[] getInputSofas()
        Gets the inputs Sofa names of this Capability.
        Returns:
        an array of strings representing the SofAName
      • getOutputSofas

        java.lang.String[] getOutputSofas()
        Gets the output Sofa names of this Capability.
        Returns:
        an array of strings representing output SofA names
      • getPreconditions

        Precondition[] getPreconditions()
        Retrieves the preconditions that must be satisfied in order for the Resource to begin processing.
        Returns:
        an unmodifiable list of Preconditions.
      • getLanguagesSupported

        java.lang.String[] getLanguagesSupported()
        A convenience method that analyzes the preconditions of this Capability and returns the ISO language identifiers that the Resource supports. This is only meaningful when analyzing text documents.
        Returns:
        an array of ISO language identifiers. An empty array means that the Resource claims to be language-independent.
      • getMimeTypesSupported

        java.lang.String[] getMimeTypesSupported()
        A convenience method that analyzes the preconditions of this Capability and returns the MIME types that the Resource can take as input.
        Returns:
        an array of MIME types. This may be empty if the Resource does not declare MIME type preconditions.
      • setInputs

        void setInputs​(TypeOrFeature[] aInputs)
        Sets the inputs of this Capability.
        Parameters:
        aInputs - an array of references to Types or Features in this Resource's TypeSystem.
      • setOutputs

        void setOutputs​(TypeOrFeature[] aOutputs)
        Sets the outputs of this Capability.
        Parameters:
        aOutputs - an array of references to Types or Features in this Resource's TypeSystem.
      • setInputSofas

        void setInputSofas​(java.lang.String[] aInputSofas)
        Sets the input Sofa names.
        Parameters:
        aInputSofas - an array of strings containing SofA names
      • setOutputSofas

        void setOutputSofas​(java.lang.String[] aOutputSofas)
        Sets the output Sofa names of this capability
        Parameters:
        aOutputSofas - an array of strings containing SoFA name
      • setPreconditions

        void setPreconditions​(Precondition[] aPreconditions)
        Sets the Preconditions of this Capability.
        Parameters:
        aPreconditions - an array of Precondition objects
        Throws:
        UIMA_UnsupportedOperationException - if this MetaDataObject is not modifiable.
      • setLanguagesSupported

        void setLanguagesSupported​(java.lang.String[] aLanguageIDs)
        A convenience method that sets the languages that this Resource supports. This is only meaningful when text documents are analyzed.

        Calling this method affects the preconditions of this Capability. All other language support preconditions will be removed, but non-language related preconditions will be unaffected.

        Parameters:
        aLanguageIDs - an array of ISO language identifiers. An empty array means that the Resource claims to be language-independent.
      • setMimeTypesSupported

        void setMimeTypesSupported​(java.lang.String[] aMimeTypes)
        A convenience method that sets the MIME types that this Resource can take as input.

        Calling this method affects the preconditions of this Capability. All other MIME type preconditions will be removed, but other preconditions will be unaffected.

        Parameters:
        aMimeTypes - an array of MIME types. This may be empty if the Resource does not declare MIME type preconditions.
      • addInputType

        void addInputType​(java.lang.String aTypeName,
                          boolean aAllAnnotatorFeatures)
        A convenience method that adds an input Type to this Capability.
        Parameters:
        aTypeName - the fully qualified type name
        aAllAnnotatorFeatures - if true, indicates that this Capability requires as input all features of this type that are specified in the same AnalysisEngine descriptor. If false, features must be explicitly declared by calling addInputFeature(String).
      • addInputFeature

        void addInputFeature​(java.lang.String aFeatureName)
        A convenience method that adds an input Feature to this Capability.
        Parameters:
        aFeatureName - the fully qualified feature name
      • addOutputType

        void addOutputType​(java.lang.String aTypeName,
                           boolean aAllAnnotatorFeatures)
        A convenience method that adds an output Type to this Capability.
        Parameters:
        aTypeName - the fully qualified type name
        aAllAnnotatorFeatures - if true, indicates that this Capability declares as output all features of this type that are specified in the same AnalysisEngine descriptor. If false, features must be explicitly declared by calling addOutputFeature(String).
      • addOutputFeature

        void addOutputFeature​(java.lang.String aFeatureName)
        A convenience method that adds an output Feature to this Capability.
        Parameters:
        aFeatureName - the fully qualified feature name
      • addInputSofa

        void addInputSofa​(java.lang.String aSofaName)
        A convenience method that adds an input Sofa name to this Capability.
        Parameters:
        aSofaName - the sofa to add to the inputs
      • addOutputSofa

        void addOutputSofa​(java.lang.String aSofaName)
        A convenience method that adds an output Sofa name to this Capability.
        Parameters:
        aSofaName - the sofa to add as an output
      • addSupportedLanguage

        void addSupportedLanguage​(java.lang.String aLanguage)
        A convenience method that adds a supported language to this Capability.
        Parameters:
        aLanguage - the ISO language identifier
      • removeSupportedLanguage

        void removeSupportedLanguage​(java.lang.String aLanguage)
        A convenience method that removes a supported language from this Capability.
        Parameters:
        aLanguage - the ISO language identifier