public class XmlSplitter extends Writer
Note that this class does not yet support the feature set of XML. Only the required features for XMPP are supported. XML comments and processing instructions are not supported.
| Modifier and Type | Field and Description | 
|---|---|
protected CompleteElementCallback | 
completeElementCallback  | 
| Constructor and Description | 
|---|
XmlSplitter(int bufferSize,
           CompleteElementCallback completeElementCallback)
Construct a new XML splitter. 
 | 
XmlSplitter(int bufferSize,
           CompleteElementCallback completeElementCallback,
           DeclarationCallback declarationCallback,
           ProcessingInstructionCallback processingInstructionCallback)
Construct a new XML splitter. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
close()  | 
void | 
flush()  | 
int | 
getCurrentSplittedPartSize()
Get the size in bytes of the splitted part currently being processed. 
 | 
protected void | 
newSplittedPart()  | 
protected void | 
onEndTag(String qName)  | 
protected void | 
onNextChar()  | 
protected void | 
onStartTag(String prefix,
          String localpart,
          Map<String,String> attributes)  | 
void | 
write(char[] cbuf,
     int off,
     int len)  | 
protected final CompleteElementCallback completeElementCallback
public XmlSplitter(int bufferSize, CompleteElementCallback completeElementCallback, DeclarationCallback declarationCallback, ProcessingInstructionCallback processingInstructionCallback)
bufferSize - the initial size of the buffer.completeElementCallback - the callback invoked once a complete element has been processed.declarationCallback - a optional callback for the XML declaration.processingInstructionCallback - a optional callback for Processing Instructions.public XmlSplitter(int bufferSize, CompleteElementCallback completeElementCallback)
bufferSize - the initial size of the buffer.completeElementCallback - the callback invoked once a complete element has been processed.public void write(char[] cbuf, int off, int len) throws IOException
write in class WriterIOExceptionpublic void flush() throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void close() throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic final int getCurrentSplittedPartSize()
protected void onNextChar() throws IOException
IOExceptionprotected void onStartTag(String prefix, String localpart, Map<String,String> attributes)
protected final void newSplittedPart()