Gets the property of the given object. @param object which to be got @return the property of the given object @throws RuntimeException if the property could not be evaluated
(final Object object)
| 78 | * @throws RuntimeException if the property could not be evaluated |
| 79 | */ |
| 80 | @Override |
| 81 | public Object getProperty(final Object object) { |
| 82 | MetaMethod getter = getGetter(); |
| 83 | if (getter == null) { |
| 84 | if (getField() != null) { |
| 85 | return getField().getProperty(object); |
| 86 | } |
| 87 | //TODO: create a WriteOnlyException class? |
| 88 | throw new GroovyRuntimeException("Cannot read write-only property: " + name); |
| 89 | } |
| 90 | return getter.invoke(object, MetaClassHelper.EMPTY_ARRAY); |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Sets the property on the given object to the new value. |
no test coverage detected