Package org.jxmpp.xml.splitter
Class XmppXmlSplitter
- java.lang.Object
-
- java.io.Writer
-
- org.jxmpp.xml.splitter.XmlSplitter
-
- org.jxmpp.xml.splitter.XmppXmlSplitter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
public class XmppXmlSplitter extends XmlSplitter
A XML splitter for XMPP. UnlikeXmlSplitter
, this splitter is aware of the special semantics of XMPP's<stream:stream>
element.
-
-
Field Summary
-
Fields inherited from class org.jxmpp.xml.splitter.XmlSplitter
completeElementCallback
-
-
Constructor Summary
Constructors Constructor Description XmppXmlSplitter(int maxElementSize, XmppElementCallback xmppElementCallback)
Construct a new XMPP XML splitter.XmppXmlSplitter(int maxElementSize, XmppElementCallback xmppElementCallback, DeclarationCallback declarationCallback, ProcessingInstructionCallback processingInstructionCallback)
Construct a new XMPP XML splitter.XmppXmlSplitter(int maxElementSize, XmppElementCallback xmppElementCallback, DeclarationCallback declarationCallback, ProcessingInstructionCallback processingInstructionCallback, XmlPrinter xmlPrinter)
Construct a new XMPP XML splitter.XmppXmlSplitter(int maxElementSize, XmppElementCallback xmppElementCallback, XmlPrinter xmlPrinter)
Constructs a new XMPP XML splitter.XmppXmlSplitter(XmlPrinter xmlPrinter)
Constructs a new XMPP XML splitter without any maximum element size restrictions using the given XML printer.XmppXmlSplitter(XmppElementCallback xmppElementCallback)
Construct a new XMPP XML splitter with a max element size of 10000.XmppXmlSplitter(XmppElementCallback xmppElementCallback, DeclarationCallback declarationCallback, ProcessingInstructionCallback processingInstructionCallback)
Construct a new XMPP XML splitter with a max element size of 10000.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
onEndTag(String qName)
protected void
onNextChar()
protected void
onStartTag(String prefix, String localpart, Map<String,String> attributes)
-
Methods inherited from class org.jxmpp.xml.splitter.XmlSplitter
close, flush, getCurrentSplittedPartSize, newSplittedPart, write
-
-
-
-
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 IOException
- Overrides:
onNextChar
in classXmlSplitter
- Throws:
IOException
-
onStartTag
protected void onStartTag(String prefix, String localpart, Map<String,String> attributes)
- Overrides:
onStartTag
in classXmlSplitter
-
onEndTag
protected void onEndTag(String qName)
- Overrides:
onEndTag
in classXmlSplitter
-
-