|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.joda.property.impl.AbstractModelElement | +--org.joda.property.impl.AbstractProperty | +--org.joda.property.impl.link.DefaultLinkProperty
Standard link view implementation which links one Bean to another.
This view does not hold the link, it simply provides convenient methods to manipulate the link. The method node() refers to the parent bean.
Nested Class Summary |
Nested classes inherited from class org.joda.property.Property |
Property.Internal |
Constructor Summary | |
DefaultLinkProperty()
Constructor. |
Method Summary | |
protected Bean |
createBean(java.lang.Class intface)
Create a new child ModelProperty given an interface. |
protected Property |
createClonedProperty(Bean bean)
Create a clone of this property, ignoring the data contents |
Bean |
getBean()
Get the bean that this link points to, that may be null |
Bean |
getBean(boolean createIfNull)
Get the Bean that is currently linked, optionally creating it. |
java.util.List |
getBeanList()
Get the beans being linked to as a list. |
java.lang.String |
getContentName()
Get the name of the linked bean |
java.lang.Class |
getContentType()
Get the type of the linked bean |
protected Bean |
getInternal()
Get the bean that this LinkProperty wraps |
java.lang.Class |
getPropertyType()
Get the type that this property is. |
void |
initPropertyCreated(PropertyInit init)
Initialize the link, after the constructor |
protected void |
populateClonedProperty(IdentityBasedHashMap clonedObjects,
Property property)
Populate the clone of this property with the same data as this one |
void |
set(java.lang.Object bean)
Set the link to be the passed in bean |
protected void |
setInternal(Bean bean)
Internal method used to change the bean being linked. |
Bean |
setNew()
Create a new Bean of the correct type replacing the current underlying node in the node tree. |
Bean |
setNew(java.lang.Class type)
Create a new Bean of a specific type replacing the the current underlying node in the node tree. |
java.lang.Object |
toObject()
Get the property's value as an object. |
java.lang.String |
toString()
Get a debug string representing this object. |
Methods inherited from class org.joda.property.impl.AbstractProperty |
addPropertyChangeListener, bean, checkArgumentNotNull, checkModifiable, checkValueNotNull, checkValueNotNull, cloneDeep, convertObject, data, equals, equalsValue, firePropertyChange, firePropertyChange, getPropertyName, getThis, hashCode, initBeanCreated, isModifiable, isNull, isReadOnly, removePropertyChangeListener, setModifiable, setReadOnly, toDataString |
Methods inherited from class org.joda.property.impl.AbstractModelElement |
getAttribute, getAttributeCount, getAttributeMap, setAttribute |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.joda.property.Property |
addPropertyChangeListener, bean, equals, equalsValue, firePropertyChange, getPropertyName, hashCode, isModifiable, isNull, isReadOnly, removePropertyChangeListener, setModifiable, setReadOnly |
Methods inherited from interface org.joda.property.ModelElement |
getAttribute, getAttributeCount, getAttributeMap, setAttribute |
Constructor Detail |
public DefaultLinkProperty()
Method Detail |
public void initPropertyCreated(PropertyInit init)
initPropertyCreated
in interface InitializableProperty
initPropertyCreated
in class AbstractProperty
public java.lang.String getContentName()
getContentName
in interface Property
getContentName
in class AbstractProperty
public java.lang.Class getContentType()
getContentType
in interface Property
getContentType
in class AbstractProperty
public Bean getBean()
getBean
in interface LinkProperty
public Bean getBean(boolean createIfNull)
getBean
in interface LinkProperty
createIfNull
- create a new bean if one does not exist
public void set(java.lang.Object bean)
set
in interface LinkProperty
set
in class AbstractProperty
bean
- the bean to set the link toprotected Bean createBean(java.lang.Class intface)
intface
- the interface to create
public Bean setNew()
LinkProperty
setNew
in interface LinkProperty
LinkProperty.setNew()
public Bean setNew(java.lang.Class type)
LinkProperty
setNew
in interface LinkProperty
type
- the interface to create a Bean for
LinkProperty.setNew(Class)
protected Bean getInternal()
protected void setInternal(Bean bean)
bean
- the bean to set the link topublic java.lang.Class getPropertyType()
Property
getPropertyType
in interface Property
Property.getPropertyType()
public java.lang.Object toObject()
Property
This method has strong semantics such that where a and b are
properties of the same type, it must be true that:
b.set( a.toObject() );
a.equals(b);
In other words, the object contains all the data necessary to
recreate the property's value.
toObject
in interface Property
toObject
in class AbstractProperty
Property.toObject()
public java.util.List getBeanList()
LinkingProperty
getBeanList
in interface LinkingProperty
LinkingProperty.getBeanList()
protected Property createClonedProperty(Bean bean)
createClonedProperty
in class AbstractProperty
bean
- the bean that owns the propertyprotected void populateClonedProperty(IdentityBasedHashMap clonedObjects, Property property)
populateClonedProperty
in class AbstractProperty
clonedObjects
- the map of original element to cloned elementproperty
- the property to clone the data intopublic java.lang.String toString()
toString
in interface Property
toString
in class AbstractProperty
|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |