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:
java.lang.Appendable
public class AppendableRepresentation extends StringRepresentation implements java.lang.Appendable
Represents an appendable sequence of characters.- Author:
- Jerome Louvel
-
-
Field Summary
-
Fields inherited from class org.restlet.representation.Representation
UNKNOWN_SIZE
-
-
Constructor Summary
Constructors Constructor Description AppendableRepresentation()
Constructor.AppendableRepresentation(java.lang.CharSequence text)
Constructor.AppendableRepresentation(java.lang.CharSequence text, Language language)
Constructor.AppendableRepresentation(java.lang.CharSequence text, MediaType mediaType)
Constructor.AppendableRepresentation(java.lang.CharSequence text, MediaType mediaType, Language language)
Constructor.AppendableRepresentation(java.lang.CharSequence text, MediaType mediaType, Language language, CharacterSet characterSet)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Appendable
append(char c)
java.lang.Appendable
append(java.lang.CharSequence csq)
java.lang.Appendable
append(java.lang.CharSequence csq, int start, int end)
java.lang.String
getText()
Converts the representation to a string value.void
setText(java.lang.CharSequence text)
Sets the string value.-
Methods inherited from class org.restlet.representation.StringRepresentation
getReader, getStream, release, setCharacterSet, setText, toString, updateSize, write
-
Methods inherited from class org.restlet.representation.CharacterRepresentation
getChannel, write, write
-
Methods inherited from class org.restlet.representation.Representation
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient
-
Methods inherited from class org.restlet.representation.RepresentationInfo
getModificationDate, getTag, setModificationDate, setTag
-
Methods inherited from class org.restlet.representation.Variant
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType
-
-
-
-
Constructor Detail
-
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
public AppendableRepresentation(java.lang.CharSequence text)
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
public AppendableRepresentation(java.lang.CharSequence text, Language language)
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
public AppendableRepresentation(java.lang.CharSequence text, MediaType mediaType)
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
public AppendableRepresentation(java.lang.CharSequence text, MediaType mediaType, Language language)
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(java.lang.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 Detail
-
append
public java.lang.Appendable append(char c) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Throws:
java.io.IOException
-
append
public java.lang.Appendable append(java.lang.CharSequence csq) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Throws:
java.io.IOException
-
append
public java.lang.Appendable append(java.lang.CharSequence csq, int start, int end) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Throws:
java.io.IOException
-
getText
public java.lang.String getText()
Description copied from class:Representation
Converts 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:
getText
in classStringRepresentation
- Returns:
- The representation as a string value.
-
setText
public void setText(java.lang.CharSequence text)
Description copied from class:StringRepresentation
Sets the string value.- Overrides:
setText
in classStringRepresentation
- Parameters:
text
- The string value.
-
-