?? messageresourcesfactory.java
字號:
package jaction.utility;
import java.io.Serializable;
public abstract class MessageResourcesFactory implements Serializable {
// ---------------------------------------------------- Instance Properties
/**
* The "return null" property value to which newly created
* MessageResourcess should be initialized.
*/
protected boolean returnNull = true;
public boolean getReturnNull() {
return (this.returnNull);
}
public void setReturnNull(boolean returnNull) {
this.returnNull = returnNull;
}
// --------------------------------------------------------- Public Methods
/**
* Create and return a newly instansiated <code>MessageResources</code>.
* This method must be implemented by concrete subclasses.
*
* @param config Configuration parameter(s) for the requested bundle
*/
public abstract MessageResources createResources(String config);
// ------------------------------------------------------ Static Properties
/**
* The Java class to be used for
* <code>MessageResourcesFactory</code> instances.
*/
protected static transient Class clazz = null;
/**
* The fully qualified class name to be used for
* <code>MessageResourcesFactory</code> instances.
*/
protected static String factoryClass =
"jaction.utility.PropertyMessageResourcesFactory";
public static String getFactoryClass() {
return (MessageResourcesFactory.factoryClass);
}
public static void setFactoryClass(String factoryClass) {
MessageResourcesFactory.factoryClass = factoryClass;
MessageResourcesFactory.clazz = null;
}
// --------------------------------------------------------- Static Methods
/**
* Create and return a <code>MessageResourcesFactory</code> instance of the
* appropriate class, which can be used to create customized
* <code>MessageResources</code> instances. If no such factory can be
* created, return <code>null</code> instead.
*/
public static MessageResourcesFactory createFactory() {
// Construct a new instance of the specified factory class
try {
if (clazz == null)
clazz = Class.forName(factoryClass);
MessageResourcesFactory factory =
(MessageResourcesFactory) clazz.newInstance();
return (factory);
} catch (Throwable t) {
System.out.println("MessageResourcesFactory.createFactory");
t.printStackTrace(System.out);
return (null);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -