/** * Returns the list of sub-elements supported by a ConfigBean * @return array of classes reprensenting the sub elements of a particular * @throws ClassNotFoundException for severe errors with the model associated * with the passed config bean. */ public static Class<?>[] getSubElementsTypes(ConfigBean bean) throws ClassNotFoundException { List<Class<?>> subTypes = new ArrayList<Class<?>>(); for (ConfigModel.Property element : bean.model.elements.values()) { if (!element.isLeaf()) { ConfigModel elementModel = ((ConfigModel.Node) element).model; Class<?> subType = elementModel.classLoaderHolder.loadClass(elementModel.targetTypeName); subTypes.add(subType); } else { if (element.isCollection()) { subTypes.add(List.class); } } } return subTypes.toArray(new Class[subTypes.size()]); }
", collection: " + e.isCollection() + ", childType.getName() = " + childType.getName() ); break; else if ( e.isCollection() ) { try { final Class<?> tempClass = elementModel.classLoaderHolder.loadClass(elementModel.targetTypeName); if (element.isCollection()) {
if (element.isCollection()) {
collection = parent.model.getElement(childName).isCollection();
throw new TransactionFailure("Unknown property name " + xmlName + " on " + source.getProxyType(), null); if (prop.isCollection()) { try { List<String> values = (List<String>) writeable.getter(prop,
if (property.isCollection()) { Object nested = writableView.getter(property, parameterizedType);
if (property.isCollection()) { Collection<Dom> collection = parentDom.nodeElements(elementName); if (collection==null) {
if (property.isCollection()) { Collection<Dom> collection = parentDom.nodeElements(elementName); if (collection==null) {
private static void applyProperties(WriteableView target, List<? extends AttributeChanges> changes) throws TransactionFailure { if (changes != null) { for (AttributeChanges change : changes) { ConfigModel.Property prop = target.getProperty(change.getName()); if (prop == null) { throw new TransactionFailure("Unknown property name " + change.getName() + " on " + target.getProxyType()); } if (prop.isCollection()) { // we need access to the List try { List list = (List) target.getter(prop, ConfigSupport.class.getDeclaredMethod("defaultPropertyValue", null).getGenericReturnType()); for (String value : change.values()) { list.add(value); } } catch (NoSuchMethodException e) { throw new TransactionFailure(e.getMessage(), e); } } else { target.setter(prop, change.values()[0], String.class); } } } } }
private static void applyProperties(WriteableView target, List<? extends AttributeChanges> changes) throws TransactionFailure { if (changes != null) { for (AttributeChanges change : changes) { ConfigModel.Property prop = target.getProperty(change.getName()); if (prop == null) { throw new TransactionFailure("Unknown property name " + change.getName() + " on " + target.getProxyType()); } if (prop.isCollection()) { // we need access to the List try { List list = (List) target.getter(prop, ConfigSupport.class.getDeclaredMethod("defaultPropertyValue", null).getGenericReturnType()); for (String value : change.values()) { list.add(value); } } catch (NoSuchMethodException e) { throw new TransactionFailure(e.getMessage(), e); } } else { target.setter(prop, change.values()[0], String.class); } } } } }
/** * Returns the list of sub-elements supported by a ConfigBean * @return array of classes reprensenting the sub elements of a particular * @throws ClassNotFoundException for severe errors with the model associated * with the passed config bean. */ public static Class<?>[] getSubElementsTypes(ConfigBean bean) throws ClassNotFoundException { List<Class<?>> subTypes = new ArrayList<Class<?>>(); for (ConfigModel.Property element : bean.model.elements.values()) { if (!element.isLeaf()) { ConfigModel elementModel = ((ConfigModel.Node) element).model; Class<?> subType = elementModel.classLoaderHolder.loadClass(elementModel.targetTypeName); subTypes.add(subType); } else { if (element.isCollection()) { subTypes.add(List.class); } } } return subTypes.toArray(new Class[subTypes.size()]); }
private void applyProperties(WriteableView target, List<? extends AttributeChanges> changes) throws TransactionFailure { if (changes != null) { for (AttributeChanges change : changes) { ConfigModel.Property prop = target.getProperty(change.name); if (prop == null) { throw new TransactionFailure("Unknown property name " + change.name + " on " + target.getProxyType()); } if (prop.isCollection()) { // we need access to the List try { List list = (List) target.getter(prop, ConfigSupport.class.getDeclaredMethod("defaultPropertyValue", null).getGenericReturnType()); for (String value : change.values()) { list.add(value); } } catch (NoSuchMethodException e) { throw new TransactionFailure(e.getMessage(), e); } } else { target.setter(prop, change.values()[0], String.class); } } } }
private void applyProperties(WriteableView target, List<? extends AttributeChanges> changes) throws TransactionFailure { if (changes != null) { for (AttributeChanges change : changes) { ConfigModel.Property prop = target.getProperty(change.name); if (prop == null) { throw new TransactionFailure("Unknown property name " + change.name + " on " + target.getProxyType()); } if (prop.isCollection()) { // we need access to the List try { List list = (List) target.getter(prop, ConfigSupport.class.getDeclaredMethod("defaultPropertyValue", null).getGenericReturnType()); for (String value : change.values()) { list.add(value); } } catch (NoSuchMethodException e) { throw new TransactionFailure(e.getMessage(), e); } } else { target.setter(prop, change.values()[0], String.class); } } } }
/** * Returns the list of sub-elements supported by a ConfigBean * @return array of classes reprensenting the sub elements of a particular * @throws ClassNotFoundException for severe errors with the model associated * with the passed config bean. */ public static Class<?>[] getSubElementsTypes(ConfigBean bean) throws ClassNotFoundException { List<Class<?>> subTypes = new ArrayList<Class<?>>(); for (ConfigModel.Property element : bean.model.elements.values()) { if (!element.isLeaf()) { ConfigModel elementModel = ((ConfigModel.Node) element).model; Class<?> subType = elementModel.classLoaderHolder.get().loadClass(elementModel.targetTypeName); subTypes.add(subType); } else { if (element.isCollection()) { subTypes.add(List.class); } } } return subTypes.toArray(new Class[subTypes.size()]); }
/** * Returns the list of sub-elements supported by a ConfigBean * @return array of classes reprensenting the sub elements of a particular * @throws ClassNotFoundException for severe errors with the model associated * with the passed config bean. */ public static Class<?>[] getSubElementsTypes(ConfigBean bean) throws ClassNotFoundException { List<Class<?>> subTypes = new ArrayList<Class<?>>(); for (ConfigModel.Property element : bean.model.elements.values()) { if (!element.isLeaf()) { ConfigModel elementModel = ((ConfigModel.Node) element).model; Class<?> subType = elementModel.classLoaderHolder.get().loadClass(elementModel.targetTypeName); subTypes.add(subType); } else { if (element.isCollection()) { subTypes.add(List.class); } } } return subTypes.toArray(new Class[subTypes.size()]); }
/** * Returns the list of sub-elements supported by a ConfigBean * @return array of classes reprensenting the sub elements of a particular * @throws ClassNotFoundException for severe errors with the model associated * with the passed config bean. */ public static Class<?>[] getSubElementsTypes(ConfigBean bean) throws ClassNotFoundException { List<Class<?>> subTypes = new ArrayList<Class<?>>(); for (ConfigModel.Property element : bean.model.elements.values()) { if (!element.isLeaf()) { ConfigModel elementModel = ((ConfigModel.Node) element).model; Class<?> subType = elementModel.classLoaderHolder.loadClass(elementModel.targetTypeName); subTypes.add(subType); } else { if (element.isCollection()) { subTypes.add(List.class); } } } return subTypes.toArray(new Class[subTypes.size()]); }
protected void makeChanges() throws TransactionFailure { for (final String xmlName : mChanges.keySet()) { final Object value = mChanges.get(xmlName); final ConfigModel.Property prop = getConfigModel_Property(xmlName); if (prop.isCollection()) { handleCollection(mWriteable, prop, ListUtil.asStringList(value)); } else if (value == null || (value instanceof String)) { mWriteable.setter(prop, value, String.class); } else { throw new TransactionFailure("Illegal data type for attribute " + xmlName + ": " + value.getClass().getName()); } } }
throw new TransactionFailure("Unknown property name " + xmlName + " on " + source.getProxyType(), null); if (prop.isCollection()) { try { List<String> values = (List<String>) writeable.getter(prop,
if (property.isCollection()) { Object nested = writableView.getter(property, parameterizedType);
private static void applyProperties(WriteableView target, List<? extends AttributeChanges> changes) throws TransactionFailure { if (changes != null) { for (AttributeChanges change : changes) { ConfigModel.Property prop = target.getProperty(change.getName()); if (prop == null) { throw new TransactionFailure("Unknown property name " + change.getName() + " on " + target.getProxyType()); } if (prop.isCollection()) { // we need access to the List try { List list = (List) target.getter(prop, ConfigSupport.class.getDeclaredMethod("defaultPropertyValue", null).getGenericReturnType()); for (String value : change.values()) { list.add(value); } } catch (NoSuchMethodException e) { throw new TransactionFailure(e.getMessage(), e); } } else { target.setter(prop, change.values()[0], String.class); } } } } }