A specialized {@code NodePointer} implementation for the attributes ofa configuration node.
110111112113114115116117
} @Override public <T> T to(Object src, Class<T> targetCls, ConfigurationInterpolator ci) { ConfigurationInterpolator interpolator = fetchInterpolator(ci); return convert(interpolator.interpolate(src), targetCls, interpolator); }
134135136137138139140141142
if (isEmptyElement(src)) { return Array.newInstance(elemClass, 0); } ConfigurationInterpolator interpolator = fetchInterpolator(ci); return elemClass.isPrimitive() ? toPrimitiveArray(src, elemClass, interpolator) : toObjectArray(src, elemClass, interpolator); }
159160161162163164165166167
"Target collection must not be null!"); } if (src != null && !isEmptyElement(src)) { ConfigurationInterpolator interpolator = fetchInterpolator(ci); convertToCollection(src, elemClass, interpolator, dest); } }
273274275276277278279280281282283
@Override public final void installInterpolator( Map<String, ? extends Lookup> prefixLookups, Collection<? extends Lookup> defLookups) { InterpolatorSpecification spec = new InterpolatorSpecification.Builder() .withPrefixLookups(prefixLookups) .withDefaultLookups(defLookups) .withDefaultLookup(new ConfigurationLookup(this)) .create();
440441442443444445446447448449450
parent.addProperty("tablespaces.tablespace.name", "default"); parent.addProperty("tablespaces.tablespace(-1).name", "test"); parent.addProperty("tables.table(0).var", "${brackets:x}"); ConfigurationInterpolator interpolator = parent.getInterpolator(); interpolator.registerLookup("brackets", new Lookup() { public String lookup(String key) { return "(" + key + ")"; }
337338339340341342343344345346347
do { ConfigurationInterpolator ciOld = getInterpolator(); ConfigurationInterpolator ciNew = (ciOld != null) ? ciOld : new ConfigurationInterpolator(); Lookup confLookup = findConfigurationLookup(ciNew); if (confLookup == null) { confLookup = new ConfigurationLookup(this); } else
400401402403404405406407408409410
protected void cloneInterpolator(AbstractConfiguration orgConfig) { interpolator = new AtomicReference<ConfigurationInterpolator>(); ConfigurationInterpolator orgInterpolator = orgConfig.getInterpolator(); List<Lookup> defaultLookups = orgInterpolator.getDefaultLookups(); Lookup lookup = findConfigurationLookup(orgInterpolator, orgConfig); if (lookup != null) { defaultLookups.remove(lookup); }
5253545556575859606162
@Before public void setUp() throws Exception { // any concrete class will do PropertiesConfiguration c = new PropertiesConfiguration(); new FileHandler(c).load(ConfigurationAssert .getTestFile("test.properties")); sync = new SynchronizerTestImpl(); c.setSynchronizer(sync); config = c; }
343536373839404142434445
@Before public void setUp() throws Exception { CompositeConfiguration cc = new CompositeConfiguration(); PropertiesConfiguration pc = new PropertiesConfiguration(); FileHandler handler = new FileHandler(pc); handler.setFileName(testProperties); handler.load(); cc.addConfiguration(pc); conf = cc; nonStringTestHolder.setConfiguration(conf); }
62636465666768697071
@Before public void setUp() throws Exception { XMLConfiguration c = new XMLConfiguration(); testFile = ConfigurationAssert.getTestFile("test.xml"); new FileHandler(c).load(testFile); sync = new SynchronizerTestImpl(); c.setSynchronizer(sync); config = c; }