本文整理汇总了Java中org.apache.avalon.framework.configuration.Configuration.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getValue方法的具体用法?Java Configuration.getValue怎么用?Java Configuration.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.avalon.framework.configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.apache.avalon.framework.configuration.Configuration; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void configure(Configuration cfg) throws ConfigurationException {
super.configure(cfg);
//Bearer bar width
Configuration c = cfg.getChild("bearer-bar-width", false);
if (c != null) {
Length w = new Length(c.getValue(), "mw");
if (w.getUnit().equalsIgnoreCase("mw")) {
getITFBean().setBearerBarWidth(w.getValue() * getBean().getModuleWidth());
} else {
getITFBean().setBearerBarWidth(w.getValueAsMillimeter());
}
}
//Bearer ox
c = cfg.getChild("bearer-box", false);
if (c != null) {
getITFBean().setBearerBox(c.getValueAsBoolean());
}
}
示例2: setPDFDocVersion
import org.apache.avalon.framework.configuration.Configuration; //导入方法依赖的package包/类
private void setPDFDocVersion(Configuration cfg, PDFRenderingUtil pdfUtil) throws FOPException {
Configuration pdfVersion = cfg.getChild(PDFConfigurationConstants.PDF_VERSION, false);
if (pdfVersion != null) {
String version = pdfVersion.getValue(null);
if (version != null && version.length() != 0) {
try {
pdfUtil.setPDFVersion(version);
} catch (IllegalArgumentException e) {
throw new FOPException(e.getMessage());
}
} else {
throw new FOPException("The PDF version has not been set.");
}
}
}
示例3: createProperty
import org.apache.avalon.framework.configuration.Configuration; //导入方法依赖的package包/类
private static JMeterProperty createProperty(Configuration config, String testClass) throws IllegalAccessException,
ClassNotFoundException, InstantiationException {
String value = config.getValue(""); // $NON-NLS-1$
String name = config.getAttribute("name", value); // $NON-NLS-1$
String oname = name;
String type = config.getAttribute("propType", StringProperty.class.getName()); // $NON-NLS-1$
// Do upgrade translation:
name = NameUpdater.getCurrentName(name, testClass);
if (TestElement.GUI_CLASS.equals(name)) {
value = NameUpdater.getCurrentName(value);
} else if (TestElement.TEST_CLASS.equals(name)) {
value=testClass; // must always agree
} else {
value = NameUpdater.getCurrentName(value, name, testClass);
}
// Delete any properties whose name converts to the empty string
if (oname.length() != 0 && name.length()==0) {
return null;
}
// Create the property:
JMeterProperty prop = (JMeterProperty) Class.forName(type).newInstance();
prop.setName(name);
prop.setObjectValue(value);
return prop;
}