📄 pushinfo.java
字号:
package org.momeunit.ant.jad;import java.util.regex.Matcher;import java.util.regex.Pattern;/** * Class that describes <code>MIDlet-Push-<n></code> JAD attribute. * * @author Sergio Morozov * @version 1.1.2 */public class PushInfo{ private static final Pattern pushPattern = Pattern .compile("([^,]+),([^,]*),(.*)"); private String connectionURL = null; private String MIDletClassName = null; private String allowedSender = null; /** * Instantiates PushInfo instance. * * @since 1.1 */ public PushInfo() { super(); } /** * Instantiates PushInfo instance by parsing given attribute value. * * @param line * attribute value to parse. * @since 1.1 */ public PushInfo(String line) { if (line == null) throw new NullPointerException(); Matcher matcher = pushPattern.matcher(line); if (!matcher.matches()) throw new IllegalArgumentException(); setConURL(matcher.group(1)); setClassName(matcher.group(2)); setAllowedSender(matcher.group(3)); } /** * Instantiates PushInfo instance with specified connection URL, classname of * midlet, allowed sender parameter. * * @param connectionURL * connection URL. * @param middletClassName * classname of midlet. * @param allowedSender * allowed sender parameter. * @since 1.1 */ public PushInfo(String connectionURL, String middletClassName, String allowedSender) { super(); this.setConURL(connectionURL); this.setClassName(middletClassName); this.setAllowedSender(allowedSender); } /** * Returns allowed sender parameter. * * @return the allowed sender parameter. * @since 1.1 */ public String getAllowedSender() { return this.allowedSender; } /** * Sets allowed sender parameter. * * @param allowedSender * allowed sender parameter to set. * @since 1.1 */ public void setAllowedSender(String allowedSender) { if (allowedSender == null) throw new NullPointerException("allowedSender"); this.allowedSender = allowedSender; } /** * Returns connection URL. * * @return the connection URL. * @since 1.1 */ public String getConURL() { return this.connectionURL; } /** * Sets connection URL. * * @param connectionURL * the connection URL to set. * @since 1.1 */ public void setConURL(String connectionURL) { if (connectionURL == null) throw new NullPointerException("connectionURL"); this.connectionURL = connectionURL; } /** * Returns classname of midlet. * * @return the classname of midlet. * @since 1.1 */ public String getClassName() { return this.MIDletClassName; } /** * Sets classname of midlet. * * @param midletClassName * classname of midlet to set. * @since 1.1 */ public void setClassName(String midletClassName) { if (midletClassName == null) throw new NullPointerException( "midletClassName"); this.MIDletClassName = midletClassName; } /** * Returns the attribute value that this PushInfo object describes. * * @return the attribute value that this PushInfo object describes. * @since 1.1 */ public String getProperty() { return this.connectionURL + "," + this.MIDletClassName + "," + this.allowedSender; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -