/** * Configures a font substitution catalog * * @param substitutions font substitutions * @throws FOPException if something's wrong with the config data */ public void configure(FontSubstitutions substitutions) throws FOPException { Configuration[] substitutionCfgs = cfg.getChildren("substitution"); for (int i = 0; i < substitutionCfgs.length; i++) { Configuration fromCfg = substitutionCfgs[i].getChild("from", false); if (fromCfg == null) { throw new FOPException("'substitution' element without child 'from' element"); } Configuration toCfg = substitutionCfgs[i].getChild("to", false); if (fromCfg == null) { throw new FOPException("'substitution' element without child 'to' element"); } FontQualifier fromQualifier = getQualfierFromConfiguration(fromCfg); FontQualifier toQualifier = getQualfierFromConfiguration(toCfg); FontSubstitution substitution = new FontSubstitution(fromQualifier, toQualifier); substitutions.add(substitution); } } }
if (cfg.getChild("use-cache", false) != null) { try { fontManager.setUseCache( cfg.getChild("use-cache").getValueAsBoolean()); } catch (ConfigurationException mfue) { LogUtil.handleException(log, mfue, true); if (cfg.getChild("font-base", false) != null) { try { fontManager.setFontBaseURL( cfg.getChild("font-base").getValue(null)); } catch (MalformedURLException mfue) { LogUtil.handleException(log, mfue, true); Configuration fontsCfg = cfg.getChild("fonts", false); if (fontsCfg != null) { Configuration substitutionsCfg = fontsCfg.getChild("substitutions", false); if (substitutionsCfg != null) { FontSubstitutionsConfigurator fontSubstitutionsConfigurator Configuration referencedFontsCfg = fontsCfg.getChild("referenced-fonts", false); if (referencedFontsCfg != null) { createReferencedFontsMatcher(referencedFontsCfg, strict, fontManager);
/** * Helper method to obtain the debug glag to use from the given * configuration object. * * @param config a <code>Configuration</code> instance * @return subject line */ private boolean getDebug( Configuration config ) throws ConfigurationException { return config.getChild( "debug" ).getValueAsBoolean(); }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration configuration) throws ConfigurationException { Configuration[] interceptorConfigList = configuration.getChild("interceptors").getChildren("interceptor"); this.defaultInterceptorList = new String[interceptorConfigList.length]; for (int i = 0; i < interceptorConfigList.length; i++) { this.defaultInterceptorList[i] = interceptorConfigList[i].getValue(); } }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration config) throws ConfigurationException { this.cacheCheckFrequency = config.getChild("cacheCheckFrequency") .getValueAsLong(DEFAULT_CACHE_CHECK_FREQUENCY); this.cacheName = config.getChild("cacheName").getValue(DEFAULT_CACHE_NAME); this.configFile = config.getChild("configurationFile").getValue(null); }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration configuration) throws ConfigurationException { Configuration[] interceptorConfigList = configuration.getChild("interceptors").getChildren("interceptor"); this.defaultInterceptorList = new String[interceptorConfigList.length]; for( int i=0; i<interceptorConfigList.length; i++ ) { this.defaultInterceptorList[i] = interceptorConfigList[i].getValue(); } }
public void configure(Configuration configuration) throws ConfigurationException { /* Read configuration nodes for recursive, parallel, recursive-parallel */ this.defaultRecursive = configuration.getChild("recursive").getValueAsBoolean(false); this.defaultParallel = configuration.getChild("parallel").getValueAsBoolean(false); this.defaultRecursiveParallel = configuration.getChild("recursive-parallel").getValueAsBoolean(false); /* Read configuration node for thread pool name */ this.threadPool = configuration.getChild("thread-pool").getValue("default"); this.defaultKey = configuration.getChild("key").getValue(null); }
/** * Configure the sets of allowed, forbidden and ignored children nodes. */ public void configure(Configuration config) throws ConfigurationException { this.allowedChildren = getStringCollection(config.getChild("allowed-children")); this.forbiddenChildren = getStringCollection(config.getChild("forbidden-children")); this.ignoredChildren = getStringCollection(config.getChild("ignored-children")); }
/** * Should the default includes be read for this sitemap? */ protected static boolean isUsingDefaultIncludes(Configuration config) { return config.getChild("components").getAttributeAsBoolean("use-default-includes", true); }
/** * @return Returns the componentConfigurationPropertiesLocation. */ protected String getLocation() { return configuration.getChild("location").getValue(COMPONENT_CONFIG_PROPERTIES_VALUE ); }
/** * Helper method to obtain the subject line to use from the given * configuration object. * * @param config a <code>Configuration</code> instance * @return subject line */ private String getSubject( Configuration config ) throws ConfigurationException { return config.getChild( "subject" ).getValue(); }
/** * Helper method to obtain the maximum delay time any particular SMTP * message can be queued from a given configuration object. * * @param config a <code>Configuration</code> instance * @return maximum SMTP mail delay time */ private int getMaxDelayTime( Configuration config ) throws ConfigurationException { return config.getChild( "maximum-delay-time" ).getValueAsInteger( 0 ); }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration configuration) throws ConfigurationException { super.configure(configuration); this.maxArgLength = configuration.getChild("maxArgLength").getValueAsInteger(MAX_ARG_LENGTH); this.toStringBuilderClassName = configuration.getChild("toStringBuilderClass") .getValue(ArgumentToStringBuilderImpl.class.getName()); this.monitorAllExceptions = configuration.getChild("monitorAllExceptions").getValueAsBoolean(true); }
/** * Create a LogTarget based on a Configuration */ public final LogTarget createTarget( final Configuration configuration ) throws ConfigurationException { final Configuration confFormat = configuration.getChild( "format" ); final Formatter formatter = getFormatter( confFormat ); final LogTarget logtarget = new StreamTarget(System.out, formatter); return logtarget; }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration config) throws ConfigurationException { this.reloadScripts = config.getChild("reload-scripts").getValueAsBoolean(this.settings.isReloadingEnabled("flow")); this.checkTime = config.getChild("check-time").getValueAsLong(this.settings.getReloadDelay("flow")); }
/** * Create a LogTarget based on a Configuration */ public final LogTarget createTarget( final Configuration configuration ) throws ConfigurationException { final Configuration confFilename = configuration.getChild( "filename" ); final String filename = getFilename( confFilename.getValue() ); final File file = new File( filename ); final LogTarget logtarget = createTarget( file, configuration ); return logtarget; }
/** * @see org.apache.cocoon.components.modules.input.AbstractInputModule#getAttribute(java.lang.String, org.apache.avalon.framework.configuration.Configuration, java.util.Map) */ public Object getAttribute(String name, Configuration modeConf, Map objectModel) throws ConfigurationException { Object contextObj = getContextObject(modeConf, objectModel); if (modeConf != null) { name = modeConf.getChild("parameter").getValue(this.parameter != null ? this.parameter : name); } return JXPathHelper.getAttributeValue(name, modeConf, this.configuration, contextObj); }
public LogTarget createTarget( final Configuration configuration ) throws ConfigurationException { LF5LogTarget result = new LF5LogTarget(); Configuration child = configuration.getChild( "NDC-pattern", false ); if( null != child ) { result.setNDCFormatter( new FormatterFactory().createFormatter( child ) ); } return result; } }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration) */ public void configure(Configuration cfg) throws ConfigurationException { //Module width (MUST ALWAYS BE FIRST BECAUSE QUIET ZONE MAY DEPEND ON IT) Length mw = new Length(cfg.getChild("module-width").getValue("0.33mm"), "mm"); getUPCEANBean().setModuleWidth(mw.getValueAsMillimeter()); super.configure(cfg); //Checksum mode getUPCEANBean().setChecksumMode(ChecksumMode.byName( cfg.getChild("checksum").getValue(ChecksumMode.CP_AUTO.getName()))); }