|
||||||||||
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.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
StringRepresentation(java.lang.CharSequence text)
Constructor. |
|
StringRepresentation(java.lang.CharSequence text,
Language language)
Constructor. |
|
StringRepresentation(java.lang.CharSequence text,
MediaType mediaType)
Constructor. |
|
StringRepresentation(java.lang.CharSequence text,
MediaType mediaType,
Language language)
Constructor. |
|
StringRepresentation(java.lang.CharSequence text,
MediaType mediaType,
Language language,
CharacterSet characterSet)
Constructor. |
Method Summary | |
---|---|
java.io.InputStream |
getStream()
Returns a stream with the representation's content. |
java.lang.String |
getText()
Converts the representation to a string value. |
void |
release()
Closes and releases the input stream. |
void |
setCharacterSet(CharacterSet characterSet)
Sets the character set or null if not applicable. |
void |
setText(java.lang.String text)
Sets the string value. |
protected void |
updateSize()
Updates the expected size according to the current string value. |
void |
write(java.io.OutputStream outputStream)
Writes the representation to a byte stream. |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, getReader, write, write |
Methods inherited from class org.restlet.resource.Representation |
---|
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDownloadName, getExpirationDate, getModificationDate, getRange, getSize, getTag, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setRange, setSize, setTag, setTransient |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getIdentifier, getLanguages, getMediaType, setEncodings, setIdentifier, setIdentifier, setLanguages, setMediaType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringRepresentation(java.lang.CharSequence text)
text
- The string value.public StringRepresentation(java.lang.CharSequence text, Language language)
text
- The string value.language
- The language.public StringRepresentation(java.lang.CharSequence text, MediaType mediaType)
text
- The string value.mediaType
- The media type.public StringRepresentation(java.lang.CharSequence text, MediaType mediaType, Language language)
text
- The string value.mediaType
- The media type.language
- The language.public StringRepresentation(java.lang.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 java.io.InputStream getStream() throws java.io.IOException
Representation
getStream
in class Representation
java.io.IOException
public java.lang.String getText()
Representation
getText
in class Representation
public void release()
release
in class Representation
public void setCharacterSet(CharacterSet characterSet)
Variant
setCharacterSet
in class Variant
characterSet
- The character set or null if not applicable.public void setText(java.lang.String text)
text
- The string value.protected void updateSize()
public void write(java.io.OutputStream outputStream) throws java.io.IOException
Representation
write
in class Representation
outputStream
- The output stream.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |