org.apache.cayenne.reflect

## Class EmbeddedFieldAccessor

- java.lang.Object
- - org.apache.cayenne.reflect.EmbeddedFieldAccessor

- All Implemented Interfaces:
    Serializable, Accessor

      public class EmbeddedFieldAccessor
      extends Object
      implements Accessor

  An accessor for fields storing embedded objects. This accessor will initialize null fields with appropriate embeddable objects when needed during get and set calls.
  Since:
    3.0
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Accessor` | `embeddableAccessor`
    `protected EmbeddableDescriptor` | `embeddableDescriptor`
    `protected Accessor` | `embeddedAccessor`
    `protected String` | `propertyPath`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmbeddedFieldAccessor(EmbeddableDescriptor embeddableDescriptor, Accessor embeddedAccessor, Accessor embeddableAccessor)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `getEmbeddable(Object owner)` Returns an embeddable object for the owner object, initializing embeddable if it is null.
    `String` | `getName()` Returns property name.
    `Object` | `getValue(Object object)` Returns a property value of an object without disturbing the object fault status.
    `void` | `setValue(Object object, Object newValue)` Sets a property value of an object without disturbing the object fault status.

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

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

- - ### Field Detail

    - #### propertyPath

          protected String propertyPath

    - #### embeddedAccessor

          protected Accessor embeddedAccessor

    - #### embeddableAccessor

          protected Accessor embeddableAccessor

    - #### embeddableDescriptor

          protected EmbeddableDescriptor embeddableDescriptor

  - ### Constructor Detail

    - #### EmbeddedFieldAccessor

          public EmbeddedFieldAccessor(EmbeddableDescriptor embeddableDescriptor,
                                       Accessor embeddedAccessor,
                                       Accessor embeddableAccessor)

  - ### Method Detail

    - #### getName

          public String getName()

      Description copied from interface: `Accessor`
      Returns property name.
      Specified by:
        `getName` in interface `Accessor`

    - #### getValue

          public Object getValue(Object object)
                          throws PropertyException

      Description copied from interface: `Accessor`
      Returns a property value of an object without disturbing the object fault status.
      Specified by:
        `getValue` in interface `Accessor`
      Throws:
        `PropertyException`

    - #### setValue

          public void setValue(Object object,
                               Object newValue)
                        throws PropertyException

      Description copied from interface: `Accessor`
      Sets a property value of an object without disturbing the object fault status. Old value of the property is specified as a hint.
      Specified by:
        `setValue` in interface `Accessor`
      Throws:
        `PropertyException`

    - #### getEmbeddable

          protected Object getEmbeddable(Object owner)

      Returns an embeddable object for the owner object, initializing embeddable if it is null. Currently supports only one level of embedding.

Copyright © 2001–2021 Apache Cayenne. All rights reserved.