Class RichText

    • Constructor Detail

      • RichText

        public RichText()
        Default constructor
      • RichText

        public RichText​(RepositoryData richTextData,
                        RepositoryData folderData)
        Constructor to use when reading the rich text from the repository
        Parameters:
        richTextData - the repository data containing the rich text's data
        folderData - the repository data containing the folder's data
    • Method Detail

      • setMimeType

        public void setMimeType​(String mimeType)
        Description copied from class: Resource
        Sets the mime type of the resource's data
        Overrides:
        setMimeType in class Resource
        Parameters:
        mimeType - the mime type to set
      • setEncoding

        public void setEncoding​(String encoding)
        Description copied from class: Resource
        Sets the encoding of the resource's data
        Overrides:
        setEncoding in class Resource
        Parameters:
        encoding - the encoding to set
      • getAnnotations

        public List<StringgetAnnotations​(String name)
        Retrieves the rich text's annotations of the given name
        Parameters:
        name - the name of the annotations to retrieve
        Returns:
        the rich text's annotations of the given name
      • addAnnotations

        public void addAnnotations​(String name,
                                   String... values)
        Add annotations to the rich text
        Parameters:
        name - the name of the annotations to add
        values - annotations to add
      • removeAnnotations

        public void removeAnnotations​(String name)
        Removes the rich text's annotations of the given name
        Parameters:
        name - the name of the annotations to remove
      • getAttachmentNames

        public Collection<StringgetAttachmentNames()
        Retrieves the names of the rich text's attachments
        Returns:
        the names of the rich text's attachments
      • getRemovedAttachments

        public Collection<StringgetRemovedAttachments()
        Retrieves the names of the removed attachments of the rich text
        Returns:
        the names of the removed attachments
      • hasAttachment

        public boolean hasAttachment​(String filename)
        Checks if the rich text has an attachment with the given name
        Parameters:
        filename - the name of the attachment
        Returns:
        true if the rich text has an attachment with the given name, false otherwise
      • getAttachment

        public NamedResource getAttachment​(String filename)
        Retrieves the rich text's attachment with the given name, or null if there is no such attachment
        Parameters:
        filename - the name of the attachment to retrieve
        Returns:
        the rich text's attachment with the given name
      • addAttachment

        public void addAttachment​(NamedResource attachment)
        Adds an attachment to the rich text
        Parameters:
        attachment - the attachment to add
      • removeAttachment

        public void removeAttachment​(String filename)
        Remove an attachment from the rich text
        Parameters:
        filename - the name of the attachment to remove
      • removeAttachments

        public void removeAttachments()
        Remove all the attachments from the rich text