Package org.zkoss.bind.proxy
Class AbstractCollectionProxy<E>
- java.lang.Object
-
- org.zkoss.bind.proxy.AbstractCollectionProxy<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,java.util.Collection<E>,javassist.util.proxy.Proxy,FormProxyObject
public abstract class AbstractCollectionProxy<E> extends java.lang.Object implements java.util.Collection<E>, javassist.util.proxy.Proxy, FormProxyObject, java.io.Serializable
This class provides a skeletal implementation of the Collection- Since:
- 8.0.0
- Author:
- jumperchen
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_dirtyprotected booleanisImmutableElements
-
Constructor Summary
Constructors Constructor Description AbstractCollectionProxy(java.util.Collection<E> origin, java.lang.annotation.Annotation[] callerAnnots)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(java.util.Collection<? extends E> c)voidcacheSavePropertyBinding(java.lang.String property, SavePropertyBinding s)Cache save property binding by property stringvoidclear()java.util.Set<org.zkoss.util.Pair<java.lang.String,SavePropertyBinding>>collectCachedSavePropertyBinding()Collect all of collect cached save property bindingsbooleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)protected <T> TcreateProxyObject(T t)protected <T extends java.util.Collection<E>>
TgetCache()java.lang.ObjectgetOriginObject()Returns the origin object.protected abstract java.util.Collection<E>initCache()booleanisEmpty()booleanisFormDirty()Returns whether the form proxy object is dirty or not, including all of its attributes.java.util.Iterator<E>iterator()voidonDataChange(java.lang.Object o)voidonDirtyChange()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)protected java.lang.ObjectreplaceOrigin(java.lang.Object origin)voidresetFromOrigin()Resets all of the changes of this form from the origin object.booleanretainAll(java.util.Collection<?> c)protected voidsetDirty(boolean d)voidsetFormOwner(java.lang.Object owner, FormBinding binding)Sets the owner of this form with its binding.voidsetHandler(javassist.util.proxy.MethodHandler mi)voidsetPath(java.lang.String property, ProxyNode parent)Set the property of current form proxy object and it's creatorintsize()voidsubmitToOrigin(BindContext ctx)Saves all of the changes of this form to the origin object.protected static booleantestEquals(java.lang.Object e, java.lang.Object o)java.lang.Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
AbstractCollectionProxy
public AbstractCollectionProxy(java.util.Collection<E> origin, java.lang.annotation.Annotation[] callerAnnots)
-
-
Method Detail
-
initCache
protected abstract java.util.Collection<E> initCache()
-
getCache
protected <T extends java.util.Collection<E>> T getCache()
-
getOriginObject
public java.lang.Object getOriginObject()
Description copied from interface:FormProxyObjectReturns the origin object.- Specified by:
getOriginObjectin interfaceFormProxyObject
-
replaceOrigin
protected java.lang.Object replaceOrigin(java.lang.Object origin)
-
onDirtyChange
public void onDirtyChange()
-
onDataChange
public void onDataChange(java.lang.Object o)
-
setDirty
protected void setDirty(boolean d)
-
setHandler
public void setHandler(javassist.util.proxy.MethodHandler mi)
- Specified by:
setHandlerin interfacejavassist.util.proxy.Proxy
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<E>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<E>
-
iterator
public java.util.Iterator<E> iterator()
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<E>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Collection<E>
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
- Specified by:
addAllin interfacejava.util.Collection<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<E>
-
isFormDirty
public boolean isFormDirty()
Description copied from interface:FormProxyObjectReturns whether the form proxy object is dirty or not, including all of its attributes.- Specified by:
isFormDirtyin interfaceFormProxyObject
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<E>
-
resetFromOrigin
public void resetFromOrigin()
Description copied from interface:FormProxyObjectResets all of the changes of this form from the origin object.- Specified by:
resetFromOriginin interfaceFormProxyObject
-
submitToOrigin
public void submitToOrigin(BindContext ctx)
Description copied from interface:FormProxyObjectSaves all of the changes of this form to the origin object.- Specified by:
submitToOriginin interfaceFormProxyObject
-
testEquals
protected static boolean testEquals(java.lang.Object e, java.lang.Object o)
-
setFormOwner
public void setFormOwner(java.lang.Object owner, FormBinding binding)Description copied from interface:FormProxyObjectSets the owner of this form with its binding.- Specified by:
setFormOwnerin interfaceFormProxyObject- Parameters:
owner- the object associated with this form.
-
createProxyObject
protected <T> T createProxyObject(T t)
-
cacheSavePropertyBinding
public void cacheSavePropertyBinding(java.lang.String property, SavePropertyBinding s)Description copied from interface:FormProxyObjectCache save property binding by property string- Specified by:
cacheSavePropertyBindingin interfaceFormProxyObject- Parameters:
property- the property of save property bindings- the save property binding
-
collectCachedSavePropertyBinding
public java.util.Set<org.zkoss.util.Pair<java.lang.String,SavePropertyBinding>> collectCachedSavePropertyBinding()
Description copied from interface:FormProxyObjectCollect all of collect cached save property bindings- Specified by:
collectCachedSavePropertyBindingin interfaceFormProxyObject
-
setPath
public void setPath(java.lang.String property, ProxyNode parent)Description copied from interface:FormProxyObjectSet the property of current form proxy object and it's creator- Specified by:
setPathin interfaceFormProxyObject- Parameters:
property- p the propertyparent- parent the parent proxy node
-
-