Class VilArgumentProvider

  • Direct Known Subclasses:
    VilClasspathProvider

    public abstract class VilArgumentProvider
    extends java.lang.Object
    An argument provider for VIL execution. This class provides an extension point for EASy plugins.
    Author:
    Holger Eichelberger
    • Field Detail

      • active

        private boolean active
    • Constructor Detail

      • VilArgumentProvider

        public VilArgumentProvider()
    • Method Detail

      • add

        public static void add​(VilArgumentProvider provider)
        Adds an argument provider.
        Parameters:
        provider - the argument provider to be added
      • remove

        public static void remove​(VilArgumentProvider provider)
        Removes an argument provider.
        Parameters:
        provider - the argument provider to be removed
      • provideArguments

        public static void provideArguments​(PLPInfo plp,
                                            Executor executor)
        Provides arguments via the registered argument providers.
        Parameters:
        plp - the PLP to add arguments for
        executor - the executor to be provided with arguments
      • getProviderCount

        public static int getProviderCount()
        Returns the number of providers.
        Returns:
        the number of providers
      • getProvider

        public static VilArgumentProvider getProvider​(int index)
        Returns the provider specified by the given index.
        Parameters:
        index - the 0-based index of the provider to return
        Returns:
        the provider
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >=getProviderCount()
      • instances

        public static java.util.Iterator<VilArgumentProvider> instances()
        Returns all registered instances as an iterator.
        Returns:
        all provider instances
      • provideArgumentsImpl

        protected abstract void provideArgumentsImpl​(PLPInfo plp,
                                                     Executor executor)
        Actually provides the arguments for executor.
        Parameters:
        plp - the PLP to add arguments for
        executor - the executor to be provided with arguments
      • getParameterName

        public abstract java.lang.String getParameterName()
        Returns the name(s) of the parameter(s) provided by this instance. The returned information is just for displaying information to the user.
        Returns:
        the name(s) of the parameters(s)
      • getParameterType

        public abstract java.lang.String getParameterType()
        Returns the type(s) of the parameter(s) provided by this instance. The returned information is just for displaying information to the user.
        Returns:
        the type(s) of the parameters(s)
      • getName

        public abstract java.lang.String getName()
        Returns the name of this provider. The returned information is just for displaying information to the user.
        Returns:
        the name of this provider
      • acceptsFreeArguments

        public abstract boolean acceptsFreeArguments()
        Returns whether this provider accepts free arguments.
        Returns:
        true if it accepts free arguments, false else
        See Also:
        setFreeArguments(String), getFreeArguments()
      • getFreeArguments

        public abstract java.lang.String getFreeArguments()
        Returns the free arguments used by this instance.
        Returns:
        the free arguments or null or an empty string if there are none
        See Also:
        setFreeArguments(String), acceptsFreeArguments()
      • setFreeArguments

        public abstract void setFreeArguments​(java.lang.String arguments)
        Defines the free arguments to be used by this instance.
        Parameters:
        arguments - the arguments (in the format supported by this instance)
        See Also:
        acceptsFreeArguments(), getFreeArguments()
      • isActive

        public boolean isActive()
        Returns whether this provider is active.
        Returns:
        true if it is active, false else
      • setActive

        public void setActive​(boolean active)
        Changes the active state of this provider.
        Parameters:
        active - true if this provider is active, false else