⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messagebuilder.java

📁 java与模式 一书的源码
💻 JAVA
字号:
package com.javapatterns.builder.message;

import java.awt.Image;

/**
 * This is an abstract builder class for building e-mail messages
 */
abstract class MessageBuilder {
    /**
     * Return an object of the subclass appropriate for the e-mail
     * message format implied by the given destination address.
     * @param dest The e-mail address the message is to be sent to
     */
    static MessageBuilder getInstance(String dest) {
        MessageBuilder builder = null;
        //...
        return builder;
    } // getInstance(String)

    /**
     * pass the value of the "to" header field to this method.
     */
    abstract void to(String value);

    /**
     * pass the value of the "from" header field to this method.
     */
    abstract void from(String value);
    //...
    /**
     * pass the value of the "organization" header field to this method.
     */
    void organization(String value) { }

    /**
     * pass the content of a plain text body part to this method.
     */
    abstract void plainText(String content);

    /**
     * pass the content of a jpeg image body part to this method.
     */
    abstract void jpegImage(Image content) ;

    /**
     * complete and return the outbound e-mail message.
     */
    abstract OutboundMessageIF getOutboundMsg() ;
} // class MessageBuilder

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -