|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
org.restlet.resource.StringRepresentation
public class StringRepresentation
Represents an Unicode string that can be converted to any character set supported by Java.
| Field Summary |
|---|
| Fields inherited from class org.restlet.resource.Variant |
|---|
UNKNOWN_SIZE |
| Constructor Summary | |
|---|---|
StringRepresentation(CharSequence text)
Constructor. |
|
StringRepresentation(CharSequence text,
Language language)
Constructor. |
|
StringRepresentation(CharSequence text,
MediaType mediaType)
Constructor. |
|
StringRepresentation(CharSequence text,
MediaType mediaType,
Language language)
Constructor. |
|
StringRepresentation(CharSequence text,
MediaType mediaType,
Language language,
CharacterSet characterSet)
Constructor. |
|
| Method Summary | |
|---|---|
InputStream |
getStream()
Returns a stream with the representation's content. |
String |
getText()
Converts the representation to a string value. |
void |
setCharacterSet(CharacterSet characterSet)
Sets the character set or null if not applicable. |
void |
setText(String text)
Sets the string value. |
protected void |
updateSize()
Updates the expected size according to the current string value. |
void |
write(OutputStream outputStream)
Writes the representation to a byte stream. |
| Methods inherited from class org.restlet.resource.StreamRepresentation |
|---|
getChannel, write |
| Methods inherited from class org.restlet.resource.Representation |
|---|
isAvailable, isTransient, setAvailable, setTransient |
| Methods inherited from class org.restlet.resource.Variant |
|---|
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getSize, getTag, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringRepresentation(CharSequence text)
text - The string value.
public StringRepresentation(CharSequence text,
Language language)
text - The string value.language - The language.
public StringRepresentation(CharSequence text,
MediaType mediaType)
text - The string value.mediaType - The media type.
public StringRepresentation(CharSequence text,
MediaType mediaType,
Language language)
text - The string value.mediaType - The media type.language - The language.
public StringRepresentation(CharSequence text,
MediaType mediaType,
Language language,
CharacterSet characterSet)
text - The string value.mediaType - The media type.language - The language.characterSet - The character set.| Method Detail |
|---|
public InputStream getStream()
throws IOException
getStream in class RepresentationIOExceptionpublic String getText()
getText in class Representationpublic void setText(String text)
text - The string value.public void setCharacterSet(CharacterSet characterSet)
setCharacterSet in class VariantcharacterSet - The character set or null if not applicable.protected void updateSize()
public void write(OutputStream outputStream)
throws IOException
write in class RepresentationoutputStream - The output stream.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||