public interface

AutoBean

com.google.gwt.autobean.shared.AutoBean<T>
Known Indirect Subclasses

Class Overview

A controller for an implementation of a bean interface. Instances of AutoBeans are obtained from an AutoBeanFactory.

Summary

Nested Classes
@interface AutoBean.PropertyName An annotation that allows inferred property names to be overridden. 
Public Methods
abstract void accept(AutoBeanVisitor visitor)
Accept an AutoBeanVisitor.
abstract T as()
Returns a proxy implementation of the T interface which will delegate to the underlying wrapped object, if any.
abstract AutoBean<T> clone(boolean deep)
Creates a copy of the AutoBean.
abstract AutoBeanFactory getFactory()
Returns the AutoBeanFactory that created the AutoBean.
abstract <Q> Q getTag(String tagName)
Retrieve a tag value that was previously provided to setTag(String, Object).
abstract Class<T> getType()
Returns the wrapped interface type.
abstract boolean isFrozen()
Returns the value most recently passed to setFrozen(boolean), or false if it has never been called.
abstract boolean isWrapper()
Returns true if the AutoBean was provided with an external object.
abstract void setFrozen(boolean frozen)
Disallows any method calls other than getters.
abstract void setTag(String tagName, Object value)
A tag is an arbitrary piece of external metadata to be associated with the wrapped value.
abstract T unwrap()
If the AutoBean wraps an object, return the underlying object.

Public Methods

public abstract void accept (AutoBeanVisitor visitor)

Accept an AutoBeanVisitor.

Parameters
visitor an AutoBeanVisitor

public abstract T as ()

Returns a proxy implementation of the T interface which will delegate to the underlying wrapped object, if any.

Returns
  • a proxy that delegates to the wrapped object

public abstract AutoBean<T> clone (boolean deep)

Creates a copy of the AutoBean.

If the AutoBean has tags, the tags will be copied into the cloned AutoBean. If any of the tag values are AutoBeans, they will not be cloned, regardless of the value of deep.

Parameters
deep indicates if all referenced AutoBeans should be cloned
Returns
Throws
IllegalStateException if the AutoBean is a wrapper type

public abstract AutoBeanFactory getFactory ()

Returns the AutoBeanFactory that created the AutoBean.

Returns
  • an AutoBeanFactory

public abstract Q getTag (String tagName)

Retrieve a tag value that was previously provided to setTag(String, Object).

Parameters
tagName the tag name
Returns
  • the tag value

public abstract Class<T> getType ()

Returns the wrapped interface type.

public abstract boolean isFrozen ()

Returns the value most recently passed to setFrozen(boolean), or false if it has never been called.

Returns
  • true if this instance is frozen

public abstract boolean isWrapper ()

Returns true if the AutoBean was provided with an external object.

Returns
  • true if this instance is a wrapper

public abstract void setFrozen (boolean frozen)

Disallows any method calls other than getters. All setter and call operations will throw an IllegalStateException.

Parameters
frozen if true, freeze this instance

public abstract void setTag (String tagName, Object value)

A tag is an arbitrary piece of external metadata to be associated with the wrapped value.

Parameters
tagName the tag name
value the wrapped value
See Also

public abstract 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
IllegalStateException if the AutoBean is not a wrapper