protected Object getter(ConfigModel.Property target, Type t) { final Object value = _getter(target, t); if (value instanceof List) { final List valueList = (List) value; // we need to protect this list as it was obtained from a readable view... return new AbstractList() { public int size() { return valueList.size(); } public Object get(int index) { return valueList.get(index); } public boolean add(Object o) { throw new IllegalStateException("Not part of a transaction !", null); } public Object set(int index, Object element) { throw new IllegalStateException("Not part of a transaction !", null); } public Object remove(int index) { throw new IllegalStateException("Not part of a transaction !", null); } }; } return value; }
public synchronized Object getter(ConfigModel.Property property, java.lang.reflect.Type t) { Object value = bean._getter(property, t); if (value instanceof List) { if (!changedCollections.containsKey(property.xmlName())) { // wrap collections so we can record events on that collection mutation. changedCollections.put(property.xmlName(), new ProtectedList(List.class.cast(value), defaultView, property.xmlName())); } return changedCollections.get(property.xmlName()); } return value; }
protected Object getter(ConfigModel.Property target, Type t) { final Object value = _getter(target, t); if (value instanceof List) { final ConfigBean myself = this; final List valueList = (List) value; // we need to protect this list as it was obtained from a readable view... return new AbstractList() { public int size() { return valueList.size(); } public Object get(int index) { return valueList.get(index); } public boolean add(Object o) { throw new IllegalStateException("Not part of a transaction !", null); } public Object set(int index, Object element) { throw new IllegalStateException("Not part of a transaction !", null); } public Object remove(int index) { throw new IllegalStateException("Not part of a transaction !", null); } }; } return value; }
protected Object getter(ConfigModel.Property target, Type t) { final Object value = _getter(target, t); if (value instanceof List) { final List valueList = (List) value; // we need to protect this list as it was obtained from a readable view... return new AbstractList() { public int size() { return valueList.size(); } public Object get(int index) { return valueList.get(index); } public boolean add(Object o) { throw new IllegalStateException("Not part of a transaction !", null); } public Object set(int index, Object element) { throw new IllegalStateException("Not part of a transaction !", null); } public Object remove(int index) { throw new IllegalStateException("Not part of a transaction !", null); } }; } return value; }
protected Object getter(ConfigModel.Property target, Type t) { final Object value = _getter(target, t); if (value instanceof List) { final ConfigBean myself = this; final List valueList = (List) value; // we need to protect this list as it was obtained from a readable view... return new AbstractList() { public int size() { return valueList.size(); } public Object get(int index) { return valueList.get(index); } public boolean add(Object o) { throw new IllegalStateException("Not part of a transaction !", null); } public Object set(int index, Object element) { throw new IllegalStateException("Not part of a transaction !", null); } public Object remove(int index) { throw new IllegalStateException("Not part of a transaction !", null); } }; } return value; }
protected Object getter(ConfigModel.Property target, Type t) { final Object value = _getter(target, t); if (value instanceof List) { final ConfigBean myself = this; final List valueList = (List) value; // we need to protect this list as it was obtained from a readable view... return new AbstractList() { public int size() { return valueList.size(); } public Object get(int index) { return valueList.get(index); } public boolean add(Object o) { throw new IllegalStateException("Not part of a transaction !", null); } public Object set(int index, Object element) { throw new IllegalStateException("Not part of a transaction !", null); } public Object remove(int index) { throw new IllegalStateException("Not part of a transaction !", null); } }; } return value; }
public Object getter(ConfigModel.Property property, java.lang.reflect.Type t) { Object value = bean._getter(property, t); if (value instanceof List) { if (!changedCollections.containsKey(property.xmlName())) { // wrap collections so we can record events on that collection mutation. changedCollections.put(property.xmlName(), new ProtectedList(List.class.cast(value), defaultView, property.xmlName())); } return changedCollections.get(property.xmlName()); } return value; }
public Object getter(ConfigModel.Property property, java.lang.reflect.Type t) { Object value = bean._getter(property, t); if (value instanceof List) { if (!changedCollections.containsKey(property.xmlName())) { // wrap collections so we can record events on that collection mutation. changedCollections.put(property.xmlName(), new ProtectedList(List.class.cast(value), defaultView, property.xmlName())); } return changedCollections.get(property.xmlName()); } return value; }
public synchronized Object getter(ConfigModel.Property property, java.lang.reflect.Type t) { Object value = bean._getter(property, t); if (value instanceof List) { if (!changedCollections.containsKey(property.xmlName())) { // wrap collections so we can record events on that collection mutation. changedCollections.put(property.xmlName(), new ProtectedList(List.class.cast(value), defaultView, property.xmlName())); } return changedCollections.get(property.xmlName()); } return value; }
public Object getter(ConfigModel.Property property, java.lang.reflect.Type t) { Object value = bean._getter(property, t); if (value instanceof List) { if (!changedCollections.containsKey(property.xmlName())) { // wrap collections so we can record events on that collection mutation. changedCollections.put(property.xmlName(), new ProtectedList(List.class.cast(value), defaultView, property.xmlName())); } return changedCollections.get(property.xmlName()); } return value; }