|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xbean.recipe.Reference
public class Reference
Reference is a named (lazy) reference from one object to another. This data class is updated when the reference is resolved which can be immedately when the ref is created, or later when an instance with the referenced name is created.
When the reference is resolved, an optional Action will be invoked which is commonly used to update a property on the source object of the reference.
Nested Class Summary | |
---|---|
static interface |
Reference.Action
|
Constructor Summary | |
---|---|
Reference(String name)
Create a reference to the specified name. |
Method Summary | |
---|---|
Object |
get()
Gets the referenced object instance or null if the reference has not been resolved yet; |
String |
getName()
Gets the name of the referenced object. |
boolean |
isResolved()
Has this reference been resolved? |
void |
set(Object object)
Sets the referenced object instance. |
void |
setAction(Reference.Action action)
Registers an action to invoke when the instance is set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Reference(String name)
name
- the name of the referenced objectMethod Detail |
---|
public String getName()
public boolean isResolved()
public Object get()
public void set(Object object)
object
- the reference instancepublic void setAction(Reference.Action action)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |