/** * Maps a constant value to the given name. */ public ContainerBuilder constant(String name, String value) { return constant(String.class, name, value); }
/** * Maps a constant value to the given name. */ public ContainerBuilder constant(String name, int value) { return constant(int.class, name, value); }
/** * Maps a constant value to the given name. */ public ContainerBuilder constant(String name, boolean value) { return constant(boolean.class, name, value); }
/** * Maps a constant value to the given name. */ public ContainerBuilder constant(String name, double value) { return constant(double.class, name, value); }
/** * Maps a constant value to the given name. */ public ContainerBuilder constant(String name, float value) { return constant(float.class, name, value); }
/** * Maps a constant value to the given name. */ public ContainerBuilder constant(String name, long value) { return constant(long.class, name, value); }
/** * Maps a constant value to the given name. */ public ContainerBuilder constant(String name, short value) { return constant(short.class, name, value); }
/** * Maps a constant value to the given name. */ public ContainerBuilder constant(String name, char value) { return constant(char.class, name, value); }
/** * Maps a class to the given name. */ public ContainerBuilder constant(String name, Class value) { return constant(Class.class, name, value); }
/** * Maps an enum to the given name. */ public <E extends Enum<E>> ContainerBuilder constant(String name, E value) { return constant(value.getDeclaringClass(), name, value); }
public void selfRegister() { //this cannot be done in the constructor, as it causes an infinite loop builder.factory(Configuration.class, MockConfiguration.class, Scope.SINGLETON); LocatableProperties props = new LocatableProperties(); new XWorkConfigurationProvider().register(builder, props); builder.constant(XWorkConstants.DEV_MODE, "false"); builder.constant(XWorkConstants.RELOAD_XML_CONFIGURATION, "true"); builder.constant(XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE, "true"); container = builder.create(true); }
protected Container createContainer() { ContainerBuilder builder = new ContainerBuilder(); builder.constant("devMode", "false"); return builder.create(true); }
builder.factory(OgnlUtil.class, Scope.SINGLETON); builder.constant(XWorkConstants.DEV_MODE, "false"); builder.constant(XWorkConstants.LOG_MISSING_PROPERTIES, "false"); builder.constant(XWorkConstants.ENABLE_OGNL_EVAL_EXPRESSION, "false"); builder.constant(XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE, "true"); builder.constant(XWorkConstants.RELOAD_XML_CONFIGURATION, "false");