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 and 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

Methods
`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, updateSize, write`

### Methods inherited from class org.restlet.representation.CharacterRepresentation

`getChannel, write, write`

### Methods inherited from class org.restlet.representation.Representation

`checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDisposition, getDownloadName, getExpirationDate, getRange, getSize, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDisposition, setDownloadable, setDownloadName, setExpirationDate, 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, getIdentifier, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setEncodings, setIdentifier, setIdentifier, setLanguages, setLocationRef, setLocationRef, setMediaType, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### 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 interface `java.lang.Appendable`
Throws:
  `java.io.IOException`

#### append

    public java.lang.Appendable append(java.lang.CharSequence csq)
                                throws java.io.IOException

Specified by:
  `append` in interface `java.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 interface `java.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 class `StringRepresentation`
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 class `StringRepresentation`
Parameters:
  `text` - The string value.