org.apache.tapestry5.internal.services

## Class LiteralPropertyConduit

- java.lang.Object
- - org.apache.tapestry5.internal.services.PropertyConduitDelegate
  - - org.apache.tapestry5.internal.services.LiteralPropertyConduit

- All Implemented Interfaces:
    InternalPropertyConduit, AnnotationProvider, PropertyConduit, PropertyConduit2

      public class LiteralPropertyConduit
      extends PropertyConduitDelegate
      implements InternalPropertyConduit

  A PropertyConduit for a literal value in an expression, such as a number, or "true", "false" or "null".

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LiteralPropertyConduit(TypeCoercer typeCoercer, Class propertyType, AnnotationProvider annotationProvider, String description, Object value)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `get(Object instance)` Reads the property from the instance.
    `<T extends Annotation> T` | `getAnnotation(Class<T> annotationClass)` Searches for the specified annotation, returning the matching annotation instance.
    `Type` | `getPropertyGenericType()` Returns the generic type of the property
    `String` | `getPropertyName()` Returns the name of the property read or updated by the conduit or null.
    `Class` | `getPropertyType()` Returns the type of the property read or updated by the conduit.
    `void` | `set(Object instance, Object value)` Changes the current value of the property.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.tapestry5.internal.services.PropertyConduitDelegate

      `coerce, invert, range`

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

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

- - ### Constructor Detail

    - #### LiteralPropertyConduit

          public LiteralPropertyConduit(TypeCoercer typeCoercer,
                                        Class propertyType,
                                        AnnotationProvider annotationProvider,
                                        String description,
                                        Object value)

  - ### Method Detail

    - #### get

          public Object get(Object instance)

      Description copied from interface: `PropertyConduit`
      Reads the property from the instance.
      Specified by:
        `get` in interface `PropertyConduit`
      Parameters:
        `instance` - object containing the property
      Returns:
        the current value of the property

    - #### set

          public void set(Object instance,
                          Object value)

      Description copied from interface: `PropertyConduit`
      Changes the current value of the property.
      Specified by:
        `set` in interface `PropertyConduit`
      Parameters:
        `instance` - object containing the property
        `value` - to change the property to

    - #### getPropertyType

          public Class getPropertyType()

      Description copied from interface: `PropertyConduit`
      Returns the type of the property read or updated by the conduit.
      Specified by:
        `getPropertyType` in interface `PropertyConduit`

    - #### getPropertyGenericType

          public Type getPropertyGenericType()

      Description copied from interface: `PropertyConduit2`
      Returns the generic type of the property
      Specified by:
        `getPropertyGenericType` in interface `PropertyConduit2`
      See Also:
        `Method.getGenericReturnType()`, `Field.getGenericType()`

    - #### getAnnotation

          public <T extends Annotation> T getAnnotation(Class<T> annotationClass)

      Description copied from interface: `AnnotationProvider`
      Searches for the specified annotation, returning the matching annotation instance.
      Specified by:
        `getAnnotation` in interface `AnnotationProvider`
      Parameters:
        `annotationClass` - used to select the annotation to return
      Returns:
        the annotation, or null if not found

    - #### getPropertyName

          public String getPropertyName()

      Description copied from interface: `InternalPropertyConduit`
      Returns the name of the property read or updated by the conduit or null. If the expression points to a property on a bean (e.g. user.name) this method returns the last property in the chain. Otherwise this method returns `null`.
      Specified by:
        `getPropertyName` in interface `InternalPropertyConduit`
      Returns:
        property name or `null`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.