org.faktorips.runtime
Class ObjectProperty

java.lang.Object
  extended by org.faktorips.runtime.ObjectProperty
All Implemented Interfaces:
Serializable

public class ObjectProperty
extends Object
implements Serializable

An instance of this class identifies a property in an object, e.g. the name property of a specific person.

To add custom information that additionally qualifies the object property, it is possible to implement and use an IPropertyQualifier.

See Also:
Serialized Form

Constructor Summary
ObjectProperty(Object object)
          Creates an ObjectProperty that characterizes only the object but not a specific property of it.
ObjectProperty(Object object, String property)
          Creates an ObjectProperty that characterizes the object and the name of the property.
ObjectProperty(Object object, String property, int index)
          Creates a new ObjectProperty.
ObjectProperty(Object object, String property, int index, IPropertyQualifier qualifier)
          Creates a new ObjectProperty.
ObjectProperty(Object object, String property, IPropertyQualifier qualifier)
          Creates a new ObjectProperty.
 
Method Summary
 boolean equals(Object obj)
           
 int getIndex()
          In case of getObject() is an array or list this index defines which object of the index is referenced.
 Object getObject()
          The object that is identified by this ObjectProperty.
 String getProperty()
          The name of the property that is identified by this ObjectProperty.
 IPropertyQualifier getQualifier()
          Returns the IPropertyQualifier defined at the instantiation of this ObjectProperty.
 int hashCode()
           
 boolean hasIndex()
          Returns whether this ObjectProperty has an index that identifies an object in an array or list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectProperty

public ObjectProperty(Object object,
                      String property,
                      int index,
                      IPropertyQualifier qualifier)
Creates a new ObjectProperty. If the property is a list or an array the index can specify the position within the property. An index smaller than 0 indicates that it is not an indexed property.

It is possible to provide additional information using the qualifier and implementing the interface IPropertyQualifier.


ObjectProperty

public ObjectProperty(Object object,
                      String property,
                      IPropertyQualifier qualifier)
Creates a new ObjectProperty.

It is possible to provide additional information using the qualifier and implementing the interface IPropertyQualifier.


ObjectProperty

public ObjectProperty(Object object,
                      String property,
                      int index)
Creates a new ObjectProperty. If the property is a list or an array the index can specify the position within the property. An index smaller than 0 indicates that it is not an indexed property.


ObjectProperty

public ObjectProperty(Object object,
                      String property)
Creates an ObjectProperty that characterizes the object and the name of the property.


ObjectProperty

public ObjectProperty(Object object)
Creates an ObjectProperty that characterizes only the object but not a specific property of it.

Method Detail

getObject

public Object getObject()
The object that is identified by this ObjectProperty.


getProperty

public String getProperty()
The name of the property that is identified by this ObjectProperty. The property name should be available as bean property in the given object.


getIndex

public int getIndex()
In case of getObject() is an array or list this index defines which object of the index is referenced.

Returns:
The index of the referenced object in the array/list that is referenced by getObject(). Returns -1 if there is no index available.
See Also:
hasIndex()

getQualifier

public IPropertyQualifier getQualifier()
Returns the IPropertyQualifier defined at the instantiation of this ObjectProperty.

Returns:
an IPropertyQualifier containing additional information or null if no qualifier exists.

hasIndex

public boolean hasIndex()
Returns whether this ObjectProperty has an index that identifies an object in an array or list.

Returns:
true if this ObjectProperty references an index, false if there is no index available.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015. All rights reserved.