Class LoaderFromStream

java.lang.Object
org.apache.commons.digester3.plugins.RuleLoader
org.apache.commons.digester3.plugins.strategies.LoaderFromStream

public class LoaderFromStream extends RuleLoader
A rule-finding algorithm which loads an xmlplugins-format file.

Note that the "include" feature of xmlrules is not supported.

Since:
1.6
  • Field Details

    • input

      private final byte[] input
  • Constructor Details

    • LoaderFromStream

      public LoaderFromStream(InputStream s) throws Exception
      The contents of the input stream are loaded into memory, and cached for later use.

      The caller is responsible for closing the input stream after this method has returned.

      Parameters:
      s - the input stream has to be loaded into memory
      Throws:
      Exception - if any error occurs while reading the input stream
  • Method Details

    • addRules

      public void addRules(Digester d, String path) throws PluginException
      Configures the digester with custom rules for some plugged-in class.

      This method is invoked when the start of an xml tag is encountered which maps to a PluginCreateRule. Any rules added here are removed from the digester when the end of that xml tag is encountered.

      Specified by:
      addRules in class RuleLoader
      Parameters:
      d - The gigester has to be configured
      path - The path where rule has to be bound
      Throws:
      PluginException - if any error occurs