/** * @see org.springframework.extensions.config.Config#getConfigElementValue(java.lang.String) */ public String getConfigElementValue(String name) { ConfigElement ce = (ConfigElement)this.configElements.get(name); return ce != null ? ce.getValue() : null; }
@Override public String getConfigElementValue(String name) { ConfigElement ce = configElements.get(name); return ce != null ? ce.getValue() : null; }
/** * @see org.springframework.extensions.config.Config#getConfigElementValue(java.lang.String) */ public String getConfigElementValue(String name) { ConfigElement ce = (ConfigElement)this.configElements.get(name); return ce != null ? ce.getValue() : null; }
@Override public String getConfigElementValue(String name) { ConfigElement ce = configElements.get(name); return ce != null ? ce.getValue() : null; }
/** * @see org.springframework.extensions.config.Config#getConfigElementValue(java.lang.String) */ public String getConfigElementValue(String name) { ConfigElement ce = (ConfigElement)this.configElements.get(name); return ce != null ? ce.getValue() : null; }
public String getChildValue(String name) { ConfigElement ce = getChild(name); return ce != null ? ce.getValue() : null; }
public String getChildValue(String name) { ConfigElement ce = getChild(name); return ce != null ? ce.getValue() : null; }
public String getChildValue(String name) { ConfigElement ce = getChild(name); return ce != null ? ce.getValue() : null; }
private Boolean getDebugFlag(String element, Boolean defaultValue) { Boolean debugValue = defaultValue; Map<String, ConfigElement> global = scriptConfigModel.getGlobal(); if (global != null) { Object flags = global.get(FLAGS); if (flags instanceof GenericConfigElement) { ConfigElement clientDebugElement = ((GenericConfigElement) flags).getChild(element); if (clientDebugElement != null) { debugValue = Boolean.valueOf(clientDebugElement.getValue()); } } } return debugValue; }
private Boolean getDebugFlag(String element, Boolean defaultValue) { Boolean debugValue = defaultValue; Map<String, ConfigElement> global = scriptConfigModel.getGlobal(); if (global != null) { Object flags = global.get(FLAGS); if (flags instanceof GenericConfigElement) { ConfigElement clientDebugElement = ((GenericConfigElement) flags).getChild(element); if (clientDebugElement != null) { debugValue = Boolean.valueOf(clientDebugElement.getValue()); } } } return debugValue; }
private Boolean getDebugFlag(String element, Boolean defaultValue) { Boolean debugValue = defaultValue; Map<String, ConfigElement> global = scriptConfigModel.getGlobal(); if (global != null) { Object flags = global.get(FLAGS); if (flags instanceof GenericConfigElement) { ConfigElement clientDebugElement = ((GenericConfigElement) flags).getChild(element); if (clientDebugElement != null) { debugValue = Boolean.valueOf(clientDebugElement.getValue()); } } } return debugValue; }
private Boolean getDebugFlag(String element, Boolean defaultValue) { Boolean debugValue = defaultValue; Map<String, ConfigElement> global = scriptConfigModel.getGlobal(); if (global != null) { Object flags = global.get(FLAGS); if (flags instanceof GenericConfigElement) { ConfigElement clientDebugElement = ((GenericConfigElement) flags).getChild(element); if (clientDebugElement != null) { debugValue = Boolean.valueOf(clientDebugElement.getValue()); } } } return debugValue; }
String template = uriElement.getValue(); if (template == null || template.trim().length() == 0)
String template = uriElement.getValue(); if (template == null || template.trim().length() == 0)
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
assertEquals("The global-item value should be 'The global value'", "The global value", globalItem.getValue()); ConfigElement fromAddressElem = clientElem.getChild("from-email-address"); assertNotNull(fromAddressElem); String fromAddress = fromAddressElem.getValue(); assertEquals("From address should be 'me@somewhere.net'", "me@somewhere.net", fromAddress);
/** * Tests loading config from a known JAR file */ public void testJarSource() { String resDir = this.getResourcesDir(); String jarFile = "jar:file:" + resDir + "custom-config.jar!/META-INF/web-client-config-custom.xml"; JarConfigSource source = new JarConfigSource(jarFile); XMLConfigService svc = new XMLConfigService(source); svc.initConfig(); // make sure the global config is present Config config = svc.getGlobalConfig(); assertNotNull(config); // make sure the from address is present and correct ConfigElement clientElem = config.getConfigElement("client"); assertNotNull(clientElem); ConfigElement fromAddressElem = clientElem.getChild("from-email-address"); assertNotNull(fromAddressElem); String fromAddress = fromAddressElem.getValue(); assertEquals("From address should be 'me@somewhere.net'", "me@somewhere.net", fromAddress); }