Class Rule

    • Field Detail

      • digester

        protected Digester digester
        The Digester with which this Rule is associated.
      • namespaceURI

        protected String namespaceURI
        The namespace URI for which this Rule is relevant, if any.
    • Constructor Detail

      • Rule

        public Rule()

        Base constructor. Now the digester will be set when the rule is added.

    • Method Detail

      • getDigester

        public Digester getDigester()
        Identify the Digester with which this Rule is associated.
        Returns:
        the Digester with which this Rule is associated.
      • setDigester

        public void setDigester​(Digester digester)
        Set the Digester with which this Rule is associated.
        Parameters:
        digester - The digester with which to associate this rule
      • getNamespaceURI

        public String getNamespaceURI()
        Return the namespace URI for which this Rule is relevant, if any.
        Returns:
        The namespace URI for which this rule is relevant or null if none.
      • setNamespaceURI

        public void setNamespaceURI​(String namespaceURI)
        Set the namespace URI for which this Rule is relevant, if any.
        Parameters:
        namespaceURI - Namespace URI for which this Rule is relevant, or null to match independent of namespace.
      • begin

        public void begin​(String namespace,
                          String name,
                          Attributes attributes)
                   throws Exception
        This method is called when the beginning of a matching XML element is encountered. The default implementation is a NO-OP.
        Parameters:
        namespace - the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
        name - the local name if the parser is namespace aware, or just the element name otherwise
        attributes - The attribute list of this element
        Throws:
        Exception - if an error occurs while processing the event
      • body

        public void body​(String namespace,
                         String name,
                         String text)
                  throws Exception
        This method is called when the body of a matching XML element is encountered. If the element has no body, this method is not called at all. The default implementation is a NO-OP.
        Parameters:
        namespace - the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
        name - the local name if the parser is namespace aware, or just the element name otherwise
        text - The text of the body of this element
        Throws:
        Exception - if an error occurs while processing the event
      • end

        public void end​(String namespace,
                        String name)
                 throws Exception
        This method is called when the end of a matching XML element is encountered. The default implementation is a NO-OP.
        Parameters:
        namespace - the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
        name - the local name if the parser is namespace aware, or just the element name otherwise
        Throws:
        Exception - if an error occurs while processing the event
      • finish

        public void finish()
                    throws Exception
        This method is called after all parsing methods have been called, to allow Rules to remove temporary data.
        Throws:
        Exception - if an error occurs while processing the event