Class ToolConfiguration

  • All Implemented Interfaces:
    java.lang.Comparable<Configuration>

    public class ToolConfiguration
    extends Configuration

    This class handles configuration info for tools, including their key, classname, path restriction, and properties. It also does fairly aggresive validation and is able to identify if the tool is "old" (i.e. designed for VelocityTools 1.x). Once configuration is complete, a ToolInfo instance can be created by calling createInfo().

    Most users will not find themselves directly using the API of this class.

    Version:
    $Id: ToolConfiguration.java 511959 2007-02-26 19:24:39Z nbubna $
    Author:
    Nathan Bubna
    • Field Detail

      • key

        private java.lang.String key
      • classname

        private java.lang.String classname
      • restrictTo

        private java.lang.String restrictTo
      • skipSetters

        private java.lang.Boolean skipSetters
      • problem

        private java.lang.Throwable problem
    • Constructor Detail

      • ToolConfiguration

        public ToolConfiguration()
    • Method Detail

      • setKey

        public void setKey​(java.lang.String key)
      • setClass

        public void setClass​(java.lang.Class clazz)
      • setClassname

        public void setClassname​(java.lang.String classname)
      • setRestrictTo

        public void setRestrictTo​(java.lang.String path)
      • setSkipSetters

        public void setSkipSetters​(java.lang.Boolean cfgOnly)
      • getKey

        public java.lang.String getKey()
        Returns the key set for this tool. If no key has been explicitly set, this will return the result of getDefaultKey().
      • getDefaultKey

        public java.lang.String getDefaultKey()
        Returns the default key value for the set tool class. First, this looks for a DefaultKey annotation on the tool class. Then, if there is no default key annotation, the Class.getSimpleName() is transformed into the key by removing any 'Tool' suffix and lowercasing the first character. This will only return null if there is both no key and no classname set for this tool.
      • getClassname

        public java.lang.String getClassname()
      • getToolClass

        public java.lang.Class getToolClass()
      • getInvalidScopes

        public java.lang.String[] getInvalidScopes()
      • getValidScopes

        public java.lang.String[] getValidScopes()
      • digForDependencies

        private void digForDependencies​(java.lang.Class clazz)
      • getRestrictTo

        public java.lang.String getRestrictTo()
      • getSkipSetters

        public java.lang.Boolean getSkipSetters()
      • createInfo

        public ToolInfo createInfo()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Configuration
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object