Class 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
    • 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.