|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.util.beans.PropertyPath
public class PropertyPath
Encapsulates the path from an object down a set of property references. If the object is a StandardBean implementation then change listeners are registered to detect changes in the path and the representive final property is changed accordingly with events fired as needed. The property path is defined by a simple field expression language where property name references are separated by '.' characters. So, foo.bar.baz is the equivalent of: obj.getFoo().getBar().getBaz()
Nested Class Summary | |
---|---|
protected static interface |
PropertyPath.PathElement
Represents a single element from a parsed path string. |
protected static interface |
PropertyPath.PathReference
Generic worker object interface for PathElements. |
protected static class |
PropertyPath.PropertyElement
Represents a single field element refering to a bean property. |
protected class |
PropertyPath.PropertyReference
Object used to supply the field information for a given object. |
Constructor Summary | |
---|---|
PropertyPath(java.lang.String pathExpression)
|
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener that will be notified whenever this path changes. |
protected PropertyPath.PathReference |
createReference(PropertyPath.PathElement element,
java.lang.Object obj)
Returns the appropriate path reference for the specified parsed element and object value. |
protected void |
createReferences(java.lang.Object obj,
int start)
Constructs references for the specified entry on, releasing any old listeners for the path that is being replaced. |
java.lang.String |
getPathExpression()
Returns the path expression string that defines this path. |
java.lang.Object |
getProperty()
Returns the value of the property at the end of the path. |
protected void |
parsePath(java.lang.String pathExpression)
|
protected void |
referenceChanged(PropertyPath.PathReference reference)
Called when the specified PathReference has detected that its value has changed. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener that was previously registered |
void |
setObject(java.lang.Object obj)
Sets the object from which this path starts. |
void |
setProperty(java.lang.Object value)
Sets the value of the property at the end of the path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyPath(java.lang.String pathExpression)
Method Detail |
---|
public void setObject(java.lang.Object obj)
public java.lang.Object getProperty()
public void setProperty(java.lang.Object value)
public java.lang.String getPathExpression()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
protected PropertyPath.PathReference createReference(PropertyPath.PathElement element, java.lang.Object obj)
protected void createReferences(java.lang.Object obj, int start)
protected void referenceChanged(PropertyPath.PathReference reference)
protected void parsePath(java.lang.String pathExpression)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |