org.zkoss.bind.proxy
Class AbstractCollectionProxy<E>

java.lang.Object
  extended by 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, FormProxyObjectListener
Direct Known Subclasses:
ListProxy, SetProxy

public abstract class AbstractCollectionProxy<E>
extends java.lang.Object
implements java.util.Collection<E>, javassist.util.proxy.Proxy, FormProxyObject, java.io.Serializable, FormProxyObjectListener

This class provides a skeletal implementation of the Collection

Since:
8.0.0
Author:
jumperchen
See Also:
Serialized Form

Field Summary
protected  boolean _dirty
           
protected  boolean isImmutableElements
           
 
Constructor Summary
AbstractCollectionProxy(java.util.Collection<E> origin, java.lang.annotation.Annotation[] callerAnnots)
           
 
Method Summary
 boolean add(E e)
           
 boolean addAll(java.util.Collection<? extends E> c)
           
 void addFormProxyObjectListener(FormProxyObjectListener l)
          Add listener
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> c)
           
protected
<T extends java.util.Collection<E>>
T
getCache()
           
 java.lang.Object getOriginObject()
          Returns the origin object.
protected abstract  java.util.Collection<E> initCache()
           
 boolean isEmpty()
           
 boolean isFormDirty()
          Returns whether the form proxy object is dirty or not, including all of its attributes.
 java.util.Iterator<E> iterator()
           
 void onDataChange(java.lang.Object o)
          Call when the data in FormProxyObject change
 void onDirtyChange()
          Call when setting form.dirty true
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
protected  java.lang.Object replaceOrigin(java.lang.Object origin)
           
 void resetFromOrigin()
          Resets all of the changes of this form from the origin object.
 boolean retainAll(java.util.Collection<?> c)
           
protected  void setDirty(boolean d)
           
 void setFormOwner(java.lang.Object owner, FormBinding binding)
          Sets the owner of this form with its binding.
 void setHandler(javassist.util.proxy.MethodHandler mi)
           
 int size()
           
 void submitToOrigin(BindContext ctx)
          Saves all of the changes of this form to the origin object.
protected static boolean testEquals(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
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

_dirty

protected boolean _dirty

isImmutableElements

protected boolean isImmutableElements
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: FormProxyObject
Returns the origin object.

Specified by:
getOriginObject in interface FormProxyObject

replaceOrigin

protected java.lang.Object replaceOrigin(java.lang.Object origin)

addFormProxyObjectListener

public void addFormProxyObjectListener(FormProxyObjectListener l)
Description copied from interface: FormProxyObject
Add listener

Specified by:
addFormProxyObjectListener in interface FormProxyObject

onDirtyChange

public void onDirtyChange()
Description copied from interface: FormProxyObjectListener
Call when setting form.dirty true

Specified by:
onDirtyChange in interface FormProxyObjectListener

onDataChange

public void onDataChange(java.lang.Object o)
Description copied from interface: FormProxyObjectListener
Call when the data in FormProxyObject change

Specified by:
onDataChange in interface FormProxyObjectListener

setDirty

protected void setDirty(boolean d)

setHandler

public void setHandler(javassist.util.proxy.MethodHandler mi)
Specified by:
setHandler in interface javassist.util.proxy.Proxy

size

public int size()
Specified by:
size in interface java.util.Collection<E>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<E>

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<E>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<E>

iterator

public java.util.Iterator<E> iterator()
Specified by:
iterator in interface java.lang.Iterable<E>
Specified by:
iterator in interface java.util.Collection<E>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<E>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<E>

add

public boolean add(E e)
Specified by:
add in interface java.util.Collection<E>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<E>

addAll

public boolean addAll(java.util.Collection<? extends E> c)
Specified by:
addAll in interface java.util.Collection<E>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Specified by:
containsAll in interface java.util.Collection<E>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<E>

isFormDirty

public boolean isFormDirty()
Description copied from interface: FormProxyObject
Returns whether the form proxy object is dirty or not, including all of its attributes.

Specified by:
isFormDirty in interface FormProxyObject

retainAll

public boolean retainAll(java.util.Collection<?> c)
Specified by:
retainAll in interface java.util.Collection<E>

resetFromOrigin

public void resetFromOrigin()
Description copied from interface: FormProxyObject
Resets all of the changes of this form from the origin object.

Specified by:
resetFromOrigin in interface FormProxyObject

submitToOrigin

public void submitToOrigin(BindContext ctx)
Description copied from interface: FormProxyObject
Saves all of the changes of this form to the origin object.

Specified by:
submitToOrigin in interface FormProxyObject

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: FormProxyObject
Sets the owner of this form with its binding.

Specified by:
setFormOwner in interface FormProxyObject
Parameters:
owner - the object associated with this form.


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo