Package groovy.lang

# Class ExpandoMetaClass.ExpandoMetaProperty

java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.ExpandoMetaClass.ExpandoMetaProperty

All Implemented Interfaces:
  `GroovyObject`

Enclosing class:
  ExpandoMetaClass

protected class ExpandoMetaClass.ExpandoMetaProperty extends GroovyObjectSupport
Instances of this class are returned when using the `<<` left shift operator.

Example:

metaClass.myMethod `<<` { String args `->` }

This allows callbacks to the ExpandoMetaClass for registering appending methods

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected boolean`
  `isStatic`
  Indicates whether the current expando member is static.
  `protected String`
  `propertyName`
  Current expando member name being defined.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ExpandoMetaProperty(String name)`
  Creates an instance-member expando property helper.
  `protected`
  `ExpandoMetaProperty(String name, boolean isStatic)`
  Creates an expando property helper.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getProperty(String property)`
  Retrieves a property value.
  `String`
  `getPropertyName()`
  Returns the expando member name currently being configured.
  `boolean`
  `isStatic()`
  Indicates whether this helper is defining static members.
  `Object`
  `leftShift(Object arg)`
  Appends a new expando method definition using the `<<` DSL operator.
  `void`
  `setProperty(String property, Object newValue)`
  Sets the given property to the new value.

  ### Methods inherited from class groovy.lang.GroovyObjectSupport

  `getMetaClass, setMetaClass`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface groovy.lang.GroovyObject

  `invokeMethod`

- ## Field Details

  - ### propertyName

    protected String propertyName
    Current expando member name being defined.

  - ### isStatic

    protected boolean isStatic
    Indicates whether the current expando member is static.

- ## Constructor Details

  - ### ExpandoMetaProperty

    protected ExpandoMetaProperty(String name)
    Creates an instance-member expando property helper.
    Parameters:
      `name` - the member name being defined

  - ### ExpandoMetaProperty

    protected ExpandoMetaProperty(String name, boolean isStatic)
    Creates an expando property helper.
    Parameters:
      `name` - the member name being defined
      `isStatic` - whether static members are being defined

- ## Method Details

  - ### getPropertyName

    public String getPropertyName()
    Returns the expando member name currently being configured.
    Returns:
      the current member name

  - ### isStatic

    public boolean isStatic()
    Indicates whether this helper is defining static members.
    Returns:
      `true` for static definitions

  - ### leftShift

    public Object leftShift(Object arg)
    Appends a new expando method definition using the `<<` DSL operator.
    Parameters:
      `arg` - the closure defining the method body
    Returns:
      this helper for fluent use

  - ### getProperty

    public Object getProperty(String property)
    Retrieves a property value.
    Parameters:
      `property` - the name of the property of interest
    Returns:
      the given property

  - ### setProperty

    public void setProperty(String property, Object newValue)
    Sets the given property to the new value.
    Parameters:
      `property` - the name of the property of interest
      `newValue` - the new value for the property