Class DigesterLoader


  • public class DigesterLoader
    extends java.lang.Object
    This class manages the creation of Digester instances from XML digester rules files.
    Since:
    1.2
    • Constructor Summary

      Constructors 
      Constructor Description
      DigesterLoader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Digester createDigester​(java.net.URL rulesXml)
      Creates a new digester and initializes it from the specified XML file
      static Digester createDigester​(java.net.URL rulesXml, Digester rulesDigester)
      Creates a new digester and initializes it from the specified XML file.
      static Digester createDigester​(org.xml.sax.InputSource rulesSource)
      Creates a new digester and initializes it from the specified InputSource
      static Digester createDigester​(org.xml.sax.InputSource rulesSource, Digester rulesDigester)
      Creates a new digester and initializes it from the specified InputSource.
      static java.lang.Object load​(java.net.URL digesterRules, java.lang.ClassLoader classLoader, java.io.InputStream input)
      Given the digester rules XML file, a class loader, and an input stream, this method parses the input into Java objects.
      static java.lang.Object load​(java.net.URL digesterRules, java.lang.ClassLoader classLoader, java.io.InputStream input, java.lang.Object rootObject)
      Given the digester rules XML file, a class loader, and an input stream, this method parses the input into Java objects.
      static java.lang.Object load​(java.net.URL digesterRules, java.lang.ClassLoader classLoader, java.io.Reader reader)
      Given the digester rules XML file, a class loader, and an input stream, this method parses the input into Java objects.
      static java.lang.Object load​(java.net.URL digesterRules, java.lang.ClassLoader classLoader, java.io.Reader input, java.lang.Object rootObject)
      Given the digester rules XML file, a class loader, and an input stream, this method parses the input into Java objects.
      static java.lang.Object load​(java.net.URL digesterRules, java.lang.ClassLoader classLoader, java.net.URL fileURL)
      Given the digester rules XML file, a class loader, and an XML input file, this method parses the input file into Java objects.
      static java.lang.Object load​(java.net.URL digesterRules, java.lang.ClassLoader classLoader, java.net.URL fileURL, java.lang.Object rootObject)
      Given the digester rules XML file, a class loader, and an XML input file, this method parses the input file into Java objects.
      • Methods inherited from class java.lang.Object

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

      • DigesterLoader

        public DigesterLoader()
    • Method Detail

      • createDigester

        public static Digester createDigester​(org.xml.sax.InputSource rulesSource)
        Creates a new digester and initializes it from the specified InputSource
        Parameters:
        rulesSource - load the xml rules from this InputSource
        Returns:
        a new Digester initialized with the rules
      • createDigester

        public static Digester createDigester​(org.xml.sax.InputSource rulesSource,
                                              Digester rulesDigester)
        Creates a new digester and initializes it from the specified InputSource. This constructor allows the digester to be used to load the rules to be specified. This allows properties to be configured on the Digester instance before it is used.
        Parameters:
        rulesSource - load the xml rules from this InputSource
        rulesDigester - digester to load the specified XML file.
        Returns:
        a new Digester initialized with the rules
      • createDigester

        public static Digester createDigester​(java.net.URL rulesXml)
        Creates a new digester and initializes it from the specified XML file
        Parameters:
        rulesXml - URL to the XML file defining the digester rules
        Returns:
        a new Digester initialized with the rules
      • createDigester

        public static Digester createDigester​(java.net.URL rulesXml,
                                              Digester rulesDigester)
        Creates a new digester and initializes it from the specified XML file. This constructor allows specifing a rulesDigester to do the XML file loading; thus no matter the XML files is packed into a jar, a war, or a ear, the rulesDigester can always find the XML files with properly set ClassLoader.
        Parameters:
        rulesXml - URL to the XML file defining the digester rules
        rulesDigester - digester to load the specified XML file.
        Returns:
        a new Digester initialized with the rules
      • load

        public static java.lang.Object load​(java.net.URL digesterRules,
                                            java.lang.ClassLoader classLoader,
                                            java.net.URL fileURL)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXException,
                                            DigesterLoadingException
        Given the digester rules XML file, a class loader, and an XML input file, this method parses the input file into Java objects. The class loader is used by the digester to create the Java objects.
        Parameters:
        digesterRules - URL to the XML document defining the digester rules
        classLoader - the ClassLoader to register with the digester
        fileURL - URL to the XML file to parse into Java objects
        Returns:
        an Object which is the root of the network of Java objects created by digesting fileURL
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        DigesterLoadingException
      • load

        public static java.lang.Object load​(java.net.URL digesterRules,
                                            java.lang.ClassLoader classLoader,
                                            java.io.InputStream input)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXException,
                                            DigesterLoadingException
        Given the digester rules XML file, a class loader, and an input stream, this method parses the input into Java objects. The class loader is used by the digester to create the Java objects.
        Parameters:
        digesterRules - URL to the XML document defining the digester rules
        classLoader - the ClassLoader to register with the digester
        input - InputStream over the XML file to parse into Java objects
        Returns:
        an Object which is the root of the network of Java objects created by digesting fileURL
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        DigesterLoadingException
      • load

        public static java.lang.Object load​(java.net.URL digesterRules,
                                            java.lang.ClassLoader classLoader,
                                            java.io.Reader reader)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXException,
                                            DigesterLoadingException
        Given the digester rules XML file, a class loader, and an input stream, this method parses the input into Java objects. The class loader is used by the digester to create the Java objects.
        Parameters:
        digesterRules - URL to the XML document defining the digester rules
        classLoader - the ClassLoader to register with the digester
        reader - Reader over the XML file to parse into Java objects
        Returns:
        an Object which is the root of the network of Java objects created by digesting fileURL
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        DigesterLoadingException
      • load

        public static java.lang.Object load​(java.net.URL digesterRules,
                                            java.lang.ClassLoader classLoader,
                                            java.net.URL fileURL,
                                            java.lang.Object rootObject)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXException,
                                            DigesterLoadingException
        Given the digester rules XML file, a class loader, and an XML input file, this method parses the input file into Java objects. The class loader is used by the digester to create the Java objects.
        Parameters:
        digesterRules - URL to the XML document defining the digester rules
        classLoader - the ClassLoader to register with the digester
        fileURL - URL to the XML file to parse into Java objects
        rootObject - an Object to push onto the digester's stack, prior to parsing the input
        Returns:
        an Object which is the root of the network of Java objects. Usually, this will be the same object as rootObject created by digesting fileURL
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        DigesterLoadingException
      • load

        public static java.lang.Object load​(java.net.URL digesterRules,
                                            java.lang.ClassLoader classLoader,
                                            java.io.InputStream input,
                                            java.lang.Object rootObject)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXException,
                                            DigesterLoadingException
        Given the digester rules XML file, a class loader, and an input stream, this method parses the input into Java objects. The class loader is used by the digester to create the Java objects.
        Parameters:
        digesterRules - URL to the XML document defining the digester rules
        classLoader - the ClassLoader to register with the digester
        input - InputStream over the XML file to parse into Java objects
        rootObject - an Object to push onto the digester's stack, prior to parsing the input
        Returns:
        an Object which is the root of the network of Java objects created by digesting fileURL
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        DigesterLoadingException
      • load

        public static java.lang.Object load​(java.net.URL digesterRules,
                                            java.lang.ClassLoader classLoader,
                                            java.io.Reader input,
                                            java.lang.Object rootObject)
                                     throws java.io.IOException,
                                            org.xml.sax.SAXException,
                                            DigesterLoadingException
        Given the digester rules XML file, a class loader, and an input stream, this method parses the input into Java objects. The class loader is used by the digester to create the Java objects.
        Parameters:
        digesterRules - URL to the XML document defining the digester rules
        classLoader - the ClassLoader to register with the digester
        input - Reader over the XML file to parse into Java objects
        rootObject - an Object to push onto the digester's stack, prior to parsing the input
        Returns:
        an Object which is the root of the network of Java objects created by digesting fileURL
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        DigesterLoadingException