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

📄 jfmemailtextpart.java

📁 java邮件源程序
💻 JAVA
字号:
/* * Created on 2004.08.24 * JFreeMail - Java mail component * Copyright (C) 2004 Dalibor Krleza *  * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */ package org.jfreemail.core;/** * Java bean class used as text E-mail part cotainer. Here you can store * all text parts of E-mail. */public class JfmEmailTextPart extends JfmEmailPart {	/**	 * Constructing this type of object.	 *	 */	public JfmEmailTextPart() {		super();	}		/**	 * Getter for text E-mail part content type. Here you can read mime/type of	 * this E-mail part. Most mime/types you can get here are plain/text,	 * plain/html etc...	 * @return E-mail part content type.	 */	public String getContentType() {		return super.getContentType();	}	/**	 * Setter for text E-mail part content type. Here you can set E-mail part	 * content type. Content types must contain "text" or "html" string,	 * otherwise CoreException is thrown.	 * @param content_type Text E-mail part content type.	 * @throws CoreException Thrown on wrong mime/type.	 */	public void setContentType(String content_type) throws CoreException {		if (!JfmCore.checkTextType(content_type))			throw new CoreException("COR_002:Wrong content type. Should be text or html type.");		super.setContentType(content_type);	}		/**	 * Getter for text E-mail part characterset. Here you can read characterset	 * of text message stored in this part.	 * @return Text E-mail part characterset.	 */	public String getContentCharset() {		return super.getContentCharset();	}	/**	 * Setter for text E-mail part characterset. Here you can set characeterset	 * of text message stored in this part.	 * @param charset Text E-mail part characterset.	 */	public void setContentCharset(String charset) {		super.setContentCharset(charset);	}		/**	 * Getter for text E-mail part encoding. Here you can get text part encoding.	 * Most of text E-mail parts are 8bit encoded.	 * @return Text E-mail part encoding. 	 */	public String getContentEncoding() {		return super.getContentEncoding();	}	/**	 * Setter for text E-mail part encoding. Here you can set text part encoding.	 * @param encoding Text E-mail part encoding.	 */	public void setContentEncoding(String encoding) {		super.setContentEncoding(encoding);	}		/**	 * Getter for text E-mail part content. Message text.	 * @return Text E-mail part content.	 */	public String[] getContent() {		return super.getTextContent();	}	/**	 * Setter for text E-mail part content. Here you can set part message	 * text.	 * @param content Text E-mail part content.	 * @throws CoreException Thrown on wrong content type or wrong	 * content charset.	 */	public void setContent(String[] content) 	throws CoreException {		if (getContentType()==null) throw new CoreException("COR_001:No content type in email part");		if (getContentCharset()==null) throw new CoreException("COR_001:No content charset in email part");		super.setTextContent(content);	}}

⌨️ 快捷键说明

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