HasProperty Relation
(Redirected from Has Property)
Jump to navigation
Jump to search
A HasProperty Relation is an Inverse Relation to the PropertyOf Relation.
- AKA: Has Property, HasProperty.
- …
- Example(s):
public HasProperty(java.lang.String propertyName)
[1] (Hamcrest API)public MetaProperty hasProperty()
[2][3] (Groovy JDK API).- …
- Counter-Example(s)
- See: IsA Relation, Composite Entity, Java, JavaScript, Object-Oriented Programming.
References
2018a
- (Wikipedia, 2018) ⇒ https://en.wikipedia.org/wiki/Property_(programming) Retrieved:2018-5-13.
- A property, in some object-oriented programming languages, is a special sort of class member, intermediate in functionality between a field (or data member) and a method. The syntax for reading and writing of properties is like for fields, but property reads and writes are (usually) translated to 'getter' and 'setter' method calls. The field-like syntax is easier to read and write than lots of method calls, yet the interposition of method calls "under the hood" allows for data validation, active updating (e.g., of GUI elements), or implementation of what may be called “read-only fields".
See an instructive example for C# language below.
- A property, in some object-oriented programming languages, is a special sort of class member, intermediate in functionality between a field (or data member) and a method. The syntax for reading and writing of properties is like for fields, but property reads and writes are (usually) translated to 'getter' and 'setter' method calls. The field-like syntax is easier to read and write than lots of method calls, yet the interposition of method calls "under the hood" allows for data validation, active updating (e.g., of GUI elements), or implementation of what may be called “read-only fields".
2018b
- (Groovy JDK, 2018) ⇒ http://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/Object.html#hasProperty(java.lang.String) Retrieved:2018-5-13.
- QUOTE:
public MetaProperty hasProperty(String name)
Returns true of the implementing MetaClass has a property of the given name.
Note that this method will only return true for realised properties and does not take into account implementation of
getProperty
orpropertyMissing
- Parameters:
name - The name of the property of interest
- Returns:
The found MetaProperty or null if it doesn't exist
- Since:1.6.1
- See Also:
MetaObjectProtocol#hasProperty(java.lang.Object, java.lang.String)
[4]
- Parameters:
- QUOTE: