Package groovy.beans

Class DefaultPropertyAccessor

java.lang.Object
groovy.beans.DefaultPropertyAccessor
All Implemented Interfaces:
PropertyAccessor, PropertyReader, PropertyWriter

public class DefaultPropertyAccessor extends Object implements PropertyAccessor
Default PropertyAccessor implementation backed by the standard Groovy property reader and writer.
  • Field Details

    • INSTANCE

      public static final PropertyAccessor INSTANCE
      Shared accessor instance.
  • Constructor Details

    • DefaultPropertyAccessor

      public DefaultPropertyAccessor()
  • Method Details

    • read

      public Object read(Object owner, String propertyName)
      Reads the named property from the supplied owner.
      Specified by:
      read in interface PropertyReader
      Parameters:
      owner - the object that owns the property
      propertyName - the property name
      Returns:
      the property value
    • write

      public void write(Object owner, String propertyName, Object value)
      Writes the named property on the supplied owner.
      Specified by:
      write in interface PropertyWriter
      Parameters:
      owner - the object that owns the property
      propertyName - the property name
      value - the value to assign