/** Set the properties of an object passed as a parameter in one go. The <code>properties</code> are parsed relative to a <code>prefix</code>. @param obj The object to configure. @param properties A java.util.Properties containing keys and values. @param prefix Only keys having the specified prefix will be set. */ public static void setProperties(Object obj, Properties properties, String prefix) { new PaxPropertySetter(obj).setProperties(properties, prefix); }
PropertyDescriptor prop = getPropertyDescriptor(name); } else { try { setProperty(prop, name, value); } catch (PropertySetterException ex) { LogLog.warn("Failed to set property [" + name +
protected PropertyDescriptor getPropertyDescriptor(String name) { if (props == null) introspect(); for (int i = 0; i < props.length; i++) { if (name.equals(props[i].getName())) { return props[i]; } } return null; }
PropertyDescriptor prop = getPropertyDescriptor(Introspector.decapitalize(key)); if (prop != null && OptionHandler.class.isAssignableFrom(prop.getPropertyType()) prop.getPropertyType(), null); PaxPropertySetter setter = new PaxPropertySetter(opt); setter.setProperties(properties, prefix + key + "."); try { prop.getWriteMethod().invoke(this.obj, new Object[] { opt }); setProperty(key, value); activate();
public OptionHandler create(Properties variables) { Properties props = new Properties(); props.putAll(variables); props.putAll(properties); OptionHandler opt = (OptionHandler) OptionConverter.instantiateByKey(props, prefix, OptionHandler.class, null); if (opt instanceof Appender && ((Appender) opt).requiresLayout()) { Layout layout = (Layout) OptionConverter.instantiateByKey(props, prefix + ".layout", Layout.class, null); if (layout != null) { ((Appender) opt).setLayout(layout); PaxPropertySetter.setProperties(layout, props, prefix + ".layout."); } } PaxPropertySetter.setProperties(opt, props, prefix + "."); opt.activateOptions(); return opt; } }
arg = convertArg(value, paramTypes[0]); } catch (Throwable t) { throw new PropertySetterException("Conversion to type ["+paramTypes[0]+
PropertyDescriptor prop = getPropertyDescriptor(Introspector.decapitalize(key)); if (prop != null && OptionHandler.class.isAssignableFrom(prop.getPropertyType()) prop.getPropertyType(), null); PaxPropertySetter setter = new PaxPropertySetter(opt); setter.setProperties(properties, prefix + key + "."); try { prop.getWriteMethod().invoke(this.obj, new Object[] { opt }); setProperty(key, value); activate();
public OptionHandler create(Properties variables) { Properties props = new Properties(); props.putAll(variables); props.putAll(properties); OptionHandler opt = (OptionHandler) OptionConverter.instantiateByKey(props, prefix, OptionHandler.class, null); if (opt instanceof Appender && ((Appender) opt).requiresLayout()) { Layout layout = (Layout) OptionConverter.instantiateByKey(props, prefix + ".layout", Layout.class, null); if (layout != null) { ((Appender) opt).setLayout(layout); PaxPropertySetter.setProperties(layout, props, prefix + ".layout."); } } PaxPropertySetter.setProperties(opt, props, prefix + "."); opt.activateOptions(); return opt; } }
arg = convertArg(value, paramTypes[0]); } catch (Throwable t) { throw new PropertySetterException("Conversion to type ["+paramTypes[0]+
/** Set the properties of an object passed as a parameter in one go. The <code>properties</code> are parsed relative to a <code>prefix</code>. @param obj The object to configure. @param properties A java.util.Properties containing keys and values. @param prefix Only keys having the specified prefix will be set. */ public static void setProperties(Object obj, Properties properties, String prefix) { new PaxPropertySetter(obj).setProperties(properties, prefix); }
fallback = (Filter) OptionConverter.instantiateByKey(props, key + ".fallback", Filter.class, null); if (fallback != null) { PaxPropertySetter.setProperties(fallback, props, key + ".fallback.");
PropertyDescriptor prop = getPropertyDescriptor(name); } else { try { setProperty(prop, name, value); } catch (PropertySetterException ex) { LogLog.warn("Failed to set property [" + name +
protected PropertyDescriptor getPropertyDescriptor(String name) { if (props == null) introspect(); for (int i = 0; i < props.length; i++) { if (name.equals(props[i].getName())) { return props[i]; } } return null; }
fallback = (Filter) OptionConverter.instantiateByKey(props, key + ".fallback", Filter.class, null); if (fallback != null) { PaxPropertySetter.setProperties(fallback, props, key + ".fallback.");
PaxPropertySetter.setProperties(eh, edited, errorHandlerPrefix + ".");
PaxPropertySetter.setProperties(eh, edited, errorHandlerPrefix + ".");
props, layoutPrefix + ".fallback", Layout.class, null); if (fallback != null) { PaxPropertySetter.setProperties(fallback, props, layoutPrefix + ".fallback."); LogLog.debug("Parsing layout options for \"" + appenderName + "\"."); PaxPropertySetter.setProperties(layout, props, layoutPrefix + "."); LogLog.debug("End of parsing for \"" + appenderName + "\"."); PaxPropertySetter.setProperties(appender, props, prefix + "."); LogLog.debug("Parsed \"" + appenderName + "\" options.");
props, layoutPrefix + ".fallback", Layout.class, null); if (fallback != null) { PaxPropertySetter.setProperties(fallback, props, layoutPrefix + ".fallback."); LogLog.debug("Parsing layout options for \"" + appenderName + "\"."); PaxPropertySetter.setProperties(layout, props, layoutPrefix + "."); LogLog.debug("End of parsing for \"" + appenderName + "\"."); PaxPropertySetter.setProperties(appender, props, prefix + "."); LogLog.debug("Parsed \"" + appenderName + "\" options.");