Interface AutoBean<T>
-
- Type Parameters:
T- the type of interface that will be wrapped.
public interface AutoBean<T>A controller for an implementation of a bean interface. Instances of AutoBeans are obtained from anAutoBeanFactory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAutoBean.PropertyNameAn annotation that allows inferred property names to be overridden.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaccept(AutoBeanVisitor visitor)Accept an AutoBeanVisitor.Tas()Returns a proxy implementation of theTinterface which will delegate to the underlying wrapped object, if any.AutoBean<T>clone(boolean deep)Deprecated.with no replacementAutoBeanFactorygetFactory()Returns the AutoBeanFactory that created the AutoBean.<Q> QgetTag(java.lang.String tagName)Retrieve a tag value that was previously provided tosetTag(String, Object).java.lang.Class<T>getType()Returns the wrapped interface type.booleanisFrozen()Returns the value most recently passed tosetFrozen(boolean), orfalseif it has never been called.booleanisWrapper()Returnstrueif the AutoBean was provided with an external object.voidsetFrozen(boolean frozen)Disallows any method calls other than getters.voidsetTag(java.lang.String tagName, java.lang.Object value)A tag is an arbitrary piece of external metadata to be associated with the wrapped value.Tunwrap()If the AutoBean wraps an object, return the underlying object.
-
-
-
Method Detail
-
accept
void accept(AutoBeanVisitor visitor)
Accept an AutoBeanVisitor.- Parameters:
visitor- anAutoBeanVisitor
-
as
T as()
Returns a proxy implementation of theTinterface which will delegate to the underlying wrapped object, if any.- Returns:
- a proxy that delegates to the wrapped object
-
clone
@Deprecated AutoBean<T> clone(boolean deep)
Deprecated.with no replacementThis method always throws anUnsupportedOperationException. The implementation of this method in previous releases was not sufficiently robust and there are no further uses of this method within the GWT code base. Furthermore, there are many different semantics that can be applied to a cloning process that cannot be adequately addressed with a single implementation.A simple clone of an acyclic datastructure can be created by using
AutoBeanCodexto encode and decode the root object. Other cloning algorithms are best implemented by using anAutoBeanVisitor.- Throws:
java.lang.UnsupportedOperationException
-
getFactory
AutoBeanFactory getFactory()
Returns the AutoBeanFactory that created the AutoBean.- Returns:
- an AutoBeanFactory
-
getTag
<Q> Q getTag(java.lang.String tagName)
Retrieve a tag value that was previously provided tosetTag(String, Object).- Parameters:
tagName- the tag name- Returns:
- the tag value
- See Also:
setTag(String, Object)
-
getType
java.lang.Class<T> getType()
Returns the wrapped interface type.
-
isFrozen
boolean isFrozen()
Returns the value most recently passed tosetFrozen(boolean), orfalseif it has never been called.- Returns:
trueif this instance is frozen
-
isWrapper
boolean isWrapper()
Returnstrueif the AutoBean was provided with an external object.- Returns:
trueif this instance is a wrapper
-
setFrozen
void setFrozen(boolean frozen)
Disallows any method calls other than getters. All setter and call operations will throw anIllegalStateException.- Parameters:
frozen- iftrue, freeze this instance
-
setTag
void setTag(java.lang.String tagName, java.lang.Object value)A tag is an arbitrary piece of external metadata to be associated with the wrapped value.- Parameters:
tagName- the tag namevalue- the wrapped value- See Also:
getTag(String)
-
unwrap
T unwrap()
If the AutoBean wraps an object, return the underlying object. The AutoBean will no longer function once unwrapped.- Returns:
- the previously-wrapped object
- Throws:
java.lang.IllegalStateException- if the AutoBean is not a wrapper
-
-