Package org.restlet.util
Class StringReadingListener
- java.lang.Object
 - 
- org.restlet.util.ReadingListener
 - 
- org.restlet.util.ByteReadingListener
 - 
- org.restlet.util.CharacterReadingListener
 - 
- org.restlet.util.StringReadingListener
 
 
 
 
 
- 
- All Implemented Interfaces:
 SelectionListener
public abstract class StringReadingListener extends CharacterReadingListener
Selection listener notifying new content as a string.- Author:
 - Jerome Louvel
 
 
- 
- 
Constructor Summary
Constructors Constructor Description StringReadingListener(Representation source)Default constructor.StringReadingListener(Representation source, int bufferSize)Constructor. 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidonContent(java.io.Reader reader)Callback invoked when new content is available.protected abstract voidonContent(java.lang.String content)Callback invoked when new content is available.- 
Methods inherited from class org.restlet.util.CharacterReadingListener
onContent 
- 
Methods inherited from class org.restlet.util.ByteReadingListener
onContent 
- 
Methods inherited from class org.restlet.util.ReadingListener
onEnd, onError, onSelected 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
StringReadingListener
public StringReadingListener(Representation source) throws java.io.IOException
Default constructor. Uses a byte buffer ofIoUtils.BUFFER_SIZElength.- Parameters:
 source- The source representation.- Throws:
 java.io.IOException
 
- 
StringReadingListener
public StringReadingListener(Representation source, int bufferSize) throws java.io.IOException
Constructor. Uses a byte buffer of a given size.- Parameters:
 source- The source representation.bufferSize- The byte buffer to use.- Throws:
 java.io.IOException
 
 - 
 
- 
Method Detail
- 
onContent
protected final void onContent(java.io.Reader reader)
Description copied from class:CharacterReadingListenerCallback invoked when new content is available.- Specified by:
 onContentin classCharacterReadingListener- Parameters:
 reader- The reader allowing to retrieve the new content.
 
- 
onContent
protected abstract void onContent(java.lang.String content)
Callback invoked when new content is available.- Parameters:
 content- The new content.
 
 - 
 
 -