consisting of plugin name and properties.
Plugins should be specified in the form:
Both the plugin name and prop list are optional, so that the following
forms are also valid:
Defaults and aliases on plugin values apply only to the plugin name.
| Method from org.apache.openjpa.lib.conf.PluginValue Detail: |
public String getClassName() {
return _name;
}
|
protected String getInternalString() {
// should never get called
throw new IllegalStateException();
}
|
public String getProperties() {
return _props;
}
|
public String getString() {
return Configurations.getPlugin(alias(_name), _props);
}
|
public Class getValueType() {
return Object.class;
}
|
public Object instantiate(Class type,
Configuration conf,
boolean fatal) {
Object obj = newInstance(_name, type, conf, fatal);
Configurations.configureInstance(obj, conf, _props,
(fatal) ? getProperty() : null);
if (_singleton)
set(obj, true);
return obj;
}
Instantiate the plugin as an instance of the given class. |
public boolean isSingleton() {
return _singleton;
}
Whether this value is a singleton. |
protected void objectChanged() {
Object obj = get();
_name = (obj == null) ? unalias(null) : obj.getClass().getName();
_props = null;
}
|
public void set(Object obj,
boolean derived) {
if (!_singleton)
throw new IllegalStateException(_loc.get("not-singleton",
getProperty()).getMessage());
super.set(obj, derived);
}
|
public void setClassName(String name) {
assertChangeable();
String oldName = _name;
_name = name;
if (!StringUtils.equals(oldName, name)) {
if (_singleton)
set(null, true);
valueChanged();
}
}
|
protected void setInternalString(String str) {
// should never get called
throw new IllegalStateException();
}
|
public void setProperties(String props) {
String oldProps = _props;
_props = props;
if (!StringUtils.equals(oldProps, props)) {
if (_singleton)
set(null, true);
valueChanged();
}
}
|
public void setString(String str) {
assertChangeable();
_name = Configurations.getClassName(str);
_name = unalias(_name);
_props = Configurations.getProperties(str);
if (_singleton)
set(null, true);
valueChanged();
}
|