Class LoaderFromClass


  • public class LoaderFromClass
    extends RuleLoader
    A RuleLoader which invokes a static method on a target class, leaving that method to actually instantiate and add new rules to a Digester instance.
    Since:
    1.6
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class rulesClass  
      private java.lang.reflect.Method rulesMethod  
    • Constructor Summary

      Constructors 
      Constructor Description
      LoaderFromClass​(java.lang.Class rulesClass, java.lang.reflect.Method rulesMethod)
      Constructor.
      LoaderFromClass​(java.lang.Class rulesClass, java.lang.String methodName)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRules​(Digester d, java.lang.String path)
      Just invoke the target method.
      static java.lang.reflect.Method locateMethod​(java.lang.Class rulesClass, java.lang.String methodName)
      Find a method on the specified class whose name matches methodName, and whose signature is: public static void foo(Digester d, String patternPrefix);.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • rulesClass

        private java.lang.Class rulesClass
      • rulesMethod

        private java.lang.reflect.Method rulesMethod
    • Constructor Detail

      • LoaderFromClass

        public LoaderFromClass​(java.lang.Class rulesClass,
                               java.lang.reflect.Method rulesMethod)
        Constructor.
      • LoaderFromClass

        public LoaderFromClass​(java.lang.Class rulesClass,
                               java.lang.String methodName)
                        throws PluginException
        Constructor.
        Throws:
        PluginException
    • Method Detail

      • locateMethod

        public static java.lang.reflect.Method locateMethod​(java.lang.Class rulesClass,
                                                            java.lang.String methodName)
                                                     throws PluginException
        Find a method on the specified class whose name matches methodName, and whose signature is: public static void foo(Digester d, String patternPrefix);.
        Returns:
        null if no such method exists.
        Throws:
        PluginException