@Override public T makeObject() throws Exception { return objectFactory.create(); } });
@Override public T makeObject() throws Exception { return objectFactory.create(); } });
protected List<LifecycleCallback> initCallbacks() { final List<LifecycleCallback> callbacks = new ArrayList<LifecycleCallback>(); for (final ObjectFactory<LifecycleCallback> callbackFactory : callbackFactoryList) { callbacks.add(callbackFactory.create()); } return callbacks; }
protected List<LifecycleCallback> initCallbacks() { final List<LifecycleCallback> callbacks = new ArrayList<LifecycleCallback>(); for (final ObjectFactory<LifecycleCallback> callbackFactory : callbackFactoryList) { callbacks.add(callbackFactory.create()); } return callbacks; }
/** * {@inheritDoc} */ public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { final String content = IOUtils.toString(reader); final Matcher matcher = PATTERN_PLACEHOLDER.matcher(content); final StringBuffer sb = new StringBuffer(); Properties properties = null; if (propertiesFactory != null) { properties = propertiesFactory.create(); } //be sure that properties will never be null; if (properties == null) { properties = EMPTY_PROPERTIES; } while (matcher.find()) { final String variableName = matcher.group(1); LOG.debug("found placeholder: {}", variableName); matcher.appendReplacement(sb, replaceVariable(properties, variableName)); } matcher.appendTail(sb); writer.write(sb.toString()); }
/** * {@inheritDoc} */ public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { final String content = IOUtils.toString(reader); final Matcher matcher = PATTERN_PLACEHOLDER.matcher(content); final StringBuffer sb = new StringBuffer(); Properties properties = null; if (propertiesFactory != null) { properties = propertiesFactory.create(); } //be sure that properties will never be null; if (properties == null) { properties = EMPTY_PROPERTIES; } while (matcher.find()) { final String variableName = matcher.group(1); LOG.debug("found placeholder: {}", variableName); matcher.appendReplacement(sb, replaceVariable(properties, variableName)); } matcher.appendTail(sb); writer.write(sb.toString()); }
public static DefaultWroManagerFactory create(final ObjectFactory<WroConfiguration> configurationFactory) { notNull(configurationFactory); final Properties properties = configurationFactory instanceof PropertiesFactory ? ((PropertiesFactory) configurationFactory).createProperties() : new Properties(); final String wroManagerClassName = configurationFactory.create().getWroManagerClassName(); if (wroManagerClassName != null) { properties.setProperty(ConfigConstants.managerFactoryClassName.name(), wroManagerClassName); } return new DefaultWroManagerFactory(properties); }
public Collection<RequestHandler> create() { final Collection<RequestHandler> handlers = decorated.create(); for (final RequestHandler handler : handlers) { injectorProvider.create().inject(handler); } return handlers; } };
public static DefaultWroManagerFactory create(final ObjectFactory<WroConfiguration> configurationFactory) { notNull(configurationFactory); final Properties properties = configurationFactory instanceof PropertiesFactory ? ((PropertiesFactory) configurationFactory).createProperties() : new Properties(); final String wroManagerClassName = configurationFactory.create().getWroManagerClassName(); if (wroManagerClassName != null) { properties.setProperty(ConfigConstants.managerFactoryClassName.name(), wroManagerClassName); } return new DefaultWroManagerFactory(properties); }
/** * Creates configuration by looking up in servletContext attributes. If none is found, a new one will be created using * the configuration factory. * * @return {@link WroConfiguration} object. */ private WroConfiguration createConfiguration() { // Extract config from servletContext (if already configured) // TODO use a named helper final WroConfiguration configAttribute = ServletContextAttributeHelper.create(filterConfig).getWroConfiguration(); if (configAttribute != null) { setConfiguration(configAttribute); } return getWroConfigurationFactory().create(); }
/** * Creates configuration by looking up in servletContext attributes. If none is found, a new one will be created using * the configuration factory. * * @return {@link WroConfiguration} object. */ private WroConfiguration createConfiguration() { // Extract config from servletContext (if already configured) // TODO use a named helper final WroConfiguration configAttribute = ServletContextAttributeHelper.create(filterConfig).getWroConfiguration(); if (configAttribute != null) { setConfiguration(configAttribute); } return getWroConfigurationFactory().create(); }