Package org.restlet.representation
Class AppendableRepresentation
java.lang.Object
org.restlet.representation.Variant
org.restlet.representation.RepresentationInfo
org.restlet.representation.Representation
org.restlet.representation.CharacterRepresentation
org.restlet.representation.StringRepresentation
org.restlet.representation.AppendableRepresentation
- All Implemented Interfaces:
Appendable
Represents an appendable sequence of characters.
- Author:
- Jerome Louvel
-
Field Summary
Fields inherited from class org.restlet.representation.Representation
UNKNOWN_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.AppendableRepresentation(CharSequence text, Language language) Constructor.AppendableRepresentation(CharSequence text, MediaType mediaType) Constructor.AppendableRepresentation(CharSequence text, MediaType mediaType, Language language) Constructor.AppendableRepresentation(CharSequence text, MediaType mediaType, Language language, CharacterSet characterSet) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) append(CharSequence csq) append(CharSequence csq, int start, int end) getText()Converts the representation to a string value.voidsetText(CharSequence text) Sets the string value.Methods inherited from class org.restlet.representation.StringRepresentation
getReader, getStream, release, setCharacterSet, setText, toString, updateSize, writeMethods inherited from class org.restlet.representation.CharacterRepresentation
writeMethods inherited from class org.restlet.representation.Representation
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getSize, hasKnownSize, isAvailable, isEmpty, isTransient, setAvailable, setDigest, setDisposition, setExpirationDate, setRange, setSize, setTransientMethods inherited from class org.restlet.representation.RepresentationInfo
getModificationDate, getTag, setModificationDate, setTagMethods inherited from class org.restlet.representation.Variant
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType
-
Constructor Details
-
AppendableRepresentation
public AppendableRepresentation()Constructor. The following metadata are used by default: "text/plain" media type, no language and the ISO-8859-1 character set. -
AppendableRepresentation
Constructor. The following metadata are used by default: "text/plain" media type, no language and the ISO-8859-1 character set.- Parameters:
text- The string value.
-
AppendableRepresentation
Constructor. The following metadata are used by default: "text/plain" media type, no language and the ISO-8859-1 character set.- Parameters:
text- The string value.language- The language.
-
AppendableRepresentation
Constructor. The following metadata are used by default: no language and the ISO-8859-1 character set.- Parameters:
text- The string value.mediaType- The media type.
-
AppendableRepresentation
Constructor. The following metadata are used by default: ISO-8859-1 character set.- Parameters:
text- The string value.mediaType- The media type.language- The language.
-
AppendableRepresentation
public AppendableRepresentation(CharSequence text, MediaType mediaType, Language language, CharacterSet characterSet) Constructor.- Parameters:
text- The string value.mediaType- The media type.language- The language.characterSet- The character set.
-
-
Method Details
-
append
- Specified by:
appendin interfaceAppendable- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Throws:
IOException
-
getText
Description copied from class:RepresentationConverts the representation to a string value. Be careful when using this method as the conversion of large content to a string fully stored in memory can result in OutOfMemoryErrors being thrown.- Overrides:
getTextin classStringRepresentation- Returns:
- The representation as a string value.
-
setText
Description copied from class:StringRepresentationSets the string value.- Overrides:
setTextin classStringRepresentation- Parameters:
text- The string value.
-