类 ToolConfiguration

java.lang.Object
org.apache.velocity.tools.config.Configuration
org.apache.velocity.tools.config.ToolConfiguration
所有已实现的接口:
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. 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.

版本:
$Id: ToolConfiguration.java 511959 2007-02-26 19:24:39Z nbubna $
作者:
Nathan Bubna
  • 构造器详细资料

    • ToolConfiguration

      public ToolConfiguration()
  • 方法详细资料

    • setKey

      public void setKey(String key)
    • setClass

      @Deprecated public void setClass(Class clazz)
      已过时。
      This method should be avoided, since considered unsafe by the security manager.
      参数:
      clazz - the Class
      另请参阅:
    • setClass

      public void setClass(String classname)
    • setClassname

      public void setClassname(String classname)
    • setFactory

      public void setFactory(Class factory)
    • setFactoryClassname

      public void setFactoryClassname(String factoryClassname)
    • setRestrictTo

      public void setRestrictTo(String path)
    • setSkipSetters

      public void setSkipSetters(Boolean cfgOnly)
    • getKey

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

      public 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.
      返回:
      default tool key
    • getClassname

      public String getClassname()
    • getFactoryClassname

      public String getFactoryClassname()
    • getToolClass

      public Class getToolClass()
    • getFactory

      public Class getFactory()
    • getInvalidScopes

      public String[] getInvalidScopes()
    • getValidScopes

      public String[] getValidScopes()
    • getRestrictTo

      public String getRestrictTo()
    • getSkipSetters

      public Boolean getSkipSetters()
    • createInfo

      public ToolInfo createInfo()
    • addConfiguration

      public void addConfiguration(Configuration config)
      覆盖:
      addConfiguration 在类中 Configuration
    • validate

      public void validate()
      覆盖:
      validate 在类中 Configuration
    • compareTo

      public int compareTo(Configuration conf)
      指定者:
      compareTo 在接口中 Comparable<Configuration>
      覆盖:
      compareTo 在类中 Configuration
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Configuration
    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Configuration
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object