Class XmppXmlSplitter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class XmppXmlSplitter
    extends XmlSplitter
    A XML splitter for XMPP. Unlike XmlSplitter, this splitter is aware of the special semantics of XMPP's <stream:stream> element.
    • Constructor Detail

      • XmppXmlSplitter

        public XmppXmlSplitter​(XmppElementCallback xmppElementCallback)
        Construct a new XMPP XML splitter with a max element size of 10000.

        RFC 6120 § 13.12 4. requires XMPP servers to use nothing less then 10000 as maximum stanza size.

        Parameters:
        xmppElementCallback - the callback invoked once a complete element has been processed.
      • XmppXmlSplitter

        public XmppXmlSplitter​(XmppElementCallback xmppElementCallback,
                               DeclarationCallback declarationCallback,
                               ProcessingInstructionCallback processingInstructionCallback)
        Construct a new XMPP XML splitter with a max element size of 10000.

        RFC 6120 § 13.12 4. requires XMPP servers to use nothing less then 10000 as maximum stanza size.

        Parameters:
        xmppElementCallback - the callback invoked once a complete element has been processed.
        declarationCallback - a optional callback for XML Declarations.
        processingInstructionCallback - a optional callback for XML Processing Instructions.
      • XmppXmlSplitter

        public XmppXmlSplitter​(int maxElementSize,
                               XmppElementCallback xmppElementCallback)
        Construct a new XMPP XML splitter.
        Parameters:
        maxElementSize - the maximum size of a single top level element in bytes.
        xmppElementCallback - the callback invoked once a complete element has been processed.
      • XmppXmlSplitter

        public XmppXmlSplitter​(int maxElementSize,
                               XmppElementCallback xmppElementCallback,
                               DeclarationCallback declarationCallback,
                               ProcessingInstructionCallback processingInstructionCallback)
        Construct a new XMPP XML splitter.
        Parameters:
        maxElementSize - the maximum size of a single top level element in bytes.
        xmppElementCallback - the callback invoked once a complete element has been processed.
        declarationCallback - a optional callback for XML Declarations.
        processingInstructionCallback - a optional callback for XML Processing Instructions.
      • XmppXmlSplitter

        public XmppXmlSplitter​(XmlPrinter xmlPrinter)
        Constructs a new XMPP XML splitter without any maximum element size restrictions using the given XML printer.
        Parameters:
        xmlPrinter - the optional XML printer to use.
      • XmppXmlSplitter

        public XmppXmlSplitter​(int maxElementSize,
                               XmppElementCallback xmppElementCallback,
                               XmlPrinter xmlPrinter)
        Constructs a new XMPP XML splitter.
        Parameters:
        maxElementSize - the maximum size of a single top level element in bytes.
        xmppElementCallback - the callback invoked once a complete element has been processed.
        xmlPrinter - the optional XML printer to use.
      • XmppXmlSplitter

        public XmppXmlSplitter​(int maxElementSize,
                               XmppElementCallback xmppElementCallback,
                               DeclarationCallback declarationCallback,
                               ProcessingInstructionCallback processingInstructionCallback,
                               XmlPrinter xmlPrinter)
        Construct a new XMPP XML splitter.
        Parameters:
        maxElementSize - the maximum size of a single top level element in bytes.
        xmppElementCallback - the callback invoked once a complete element has been processed.
        declarationCallback - a optional callback for XML Declarations.
        processingInstructionCallback - a optional callback for XML Processing Instructions.
        xmlPrinter - The optional XML printer to use.
    • Method Detail

      • onNextChar

        protected void onNextChar()
                           throws java.io.IOException
        Overrides:
        onNextChar in class XmlSplitter
        Throws:
        java.io.IOException
      • onStartTag

        protected void onStartTag​(java.lang.String prefix,
                                  java.lang.String localpart,
                                  java.util.Map<java.lang.String,​java.lang.String> attributes)
        Overrides:
        onStartTag in class XmlSplitter
      • onEndTag

        protected void onEndTag​(java.lang.String qName)
        Overrides:
        onEndTag in class XmlSplitter