Class StaxExtractingProcessor.ElementSpec

  • Enclosing class:
    StaxExtractingProcessor

    public static class StaxExtractingProcessor.ElementSpec
    extends java.lang.Object
    An class to describe an element and what to do with it when it's encountered.
    • Method Detail

      • inclAttributeText

        public StaxExtractingProcessor.ElementSpec inclAttributeText​(java.lang.String namespaceUri,
                                                                     java.lang.String attrName)
        Causes the value of the supplied attributes to be prepended to any characters from the element. Attributes will be prepended in the order they are supplied to this method and separated by a single space, but only once per attribute. This method should NEVER be called during document processing only during configuration.
        Parameters:
        attrName - the attribute to append
        namespaceUri - the namespace for the attribute (or null for default)
        Returns:
        this object for further configuration.
      • matchOnAttrValue

        public StaxExtractingProcessor.ElementSpec matchOnAttrValue​(java.lang.String namespaceUri,
                                                                    java.lang.String attrName,
                                                                    java.util.regex.Pattern pattern)
        Causes the element to only match if the value of ALL specified attributes matches the supplied regex.
        Parameters:
        namespaceUri - The name space for the attribute (may be null for default ns)
        attrName - The qname for the attribute
        pattern - The compiled regex pattern to use for matching.
        Returns:
        this object for further configuration.
      • handleIfMatches

        public StaxExtractingProcessor.LimitedStaxHandler handleIfMatches​(org.codehaus.stax2.XMLStreamReader2 reader,
                                                                          StaxExtractingProcessor.ElementSpec spec)
        Attempt to match the current element and return a handler if successful. Note that the question of whether or not the path to this element matches is already determined by this point and only the attribute matching needs to be determined.
        Parameters:
        reader - The reader, typically during XMLStreamConstants.START_ELEMENT
        spec - The specification of how to handle the element
        Returns:
        A handler if we match null otherwise.
      • matches

        protected boolean matches​(org.codehaus.stax2.XMLStreamReader2 reader)
      • getDestField

        public java.lang.String getDestField()