public <T> T nodeByTypeElement(Class<T> baseType) { int len = children.size(); for (int i = 0; i < len; i++) { Child child = children.get(i); if (child instanceof NodeChild) { NodeChild nc = (NodeChild) child; if (model.elements.containsKey(nc.name)) continue; // match with named if (baseType.isAssignableFrom(nc.dom.getImplementationClass())) return baseType.cast(nc.dom.get()); } } return null; }
/** * Creates a strongly-typed proxy to access values in this {@link Dom} object, by using the * specified interface type as the proxy type. */ public <T extends ConfigBeanProxy> T createProxy(final Class<T> proxyType) { ConfigBeanProxy retVal = proxyCache.compute(proxyType); return proxyType.cast(retVal); }