Class DefaultMessageBuilder

    • Constructor Detail

      • DefaultMessageBuilder

        public DefaultMessageBuilder()
    • Method Detail

      • setMessageImplFactory

        public void setMessageImplFactory​(MessageImplFactory messageImplFactory)
      • setBodyFactory

        public void setBodyFactory​(BodyFactory bodyFactory)
      • setMimeEntityConfig

        public void setMimeEntityConfig​(MimeConfig config)
      • setBodyDescriptorBuilder

        public void setBodyDescriptorBuilder​(BodyDescriptorBuilder bodyDescBuilder)
      • setDecodeMonitor

        public void setDecodeMonitor​(DecodeMonitor monitor)
      • setContentDecoding

        public void setContentDecoding​(boolean contentDecoding)
      • setFlatMode

        public void setFlatMode​(boolean flatMode)
      • copy

        public Header copy​(Header other)
        Creates a new Header from the specified Header. The Header instance is initialized with a copy of the list of Fields of the specified Header. The Field objects are not copied because they are immutable and can safely be shared between headers.
        Parameters:
        other - header to copy.
      • copy

        public BodyPart copy​(Entity other)
        Creates a new BodyPart from the specified Entity. The BodyPart instance is initialized with copies of header and body of the specified Entity. The parent entity of the new body part is null.
        Parameters:
        other - body part to copy.
        Throws:
        java.lang.UnsupportedOperationException - if other contains a SingleBody that does not support the copy() operation.
        java.lang.IllegalArgumentException - if other contains a Body that is neither a Message, Multipart or SingleBody.
      • copy

        public Multipart copy​(Multipart other)
        Creates a new Multipart from the specified Multipart. The Multipart instance is initialized with copies of preamble, epilogue, sub type and the list of body parts of the specified Multipart. The parent entity of the new multipart is null.
        Parameters:
        other - multipart to copy.
        Throws:
        java.lang.UnsupportedOperationException - if other contains a SingleBody that does not support the copy() operation.
        java.lang.IllegalArgumentException - if other contains a Body that is neither a Message, Multipart or SingleBody.
      • copy

        public Body copy​(Body body)
        Returns a copy of the given Body that can be used (and modified) independently of the original. The copy should be disposed of when it is no longer needed.

        The parent of the returned copy is null, that is, the copy is detached from the parent entity of the original.

        Parameters:
        body - body to copy.
        Returns:
        a copy of the given body.
        Throws:
        java.lang.UnsupportedOperationException - if body is an instance of SingleBody that does not support the copy() operation (or contains such a SingleBody).
        java.lang.IllegalArgumentException - if body is null or body is a Body that is neither a MessageImpl, Multipart or SingleBody (or contains such a Body).
      • copy

        public Message copy​(Message other)
        Creates a new Message from the specified Message. The Message instance is initialized with copies of header and body of the specified Message. The parent entity of the new message is null.
        Parameters:
        other - message to copy.
        Throws:
        java.lang.UnsupportedOperationException - if other contains a SingleBody that does not support the copy() operation.
        java.lang.IllegalArgumentException - if other contains a Body that is neither a MessageImpl, Multipart or SingleBody.
      • newMultipart

        public Multipart newMultipart​(java.lang.String subType,
                                      NameValuePair... contentTypeParameters)
      • newMessageImpl

        private MessageImpl newMessageImpl()