Interface ValueRetriever<T>

All Known Implementing Classes:
PropertyValueRetrieverImpl, RootValueRetrieverImpl

public interface ValueRetriever<T>
Retrieves a value from an object graph.
Author:
Daniel Sagenschneider
  • Method Summary

    Modifier and Type
    Method
    Description
    <A> A
    getValueAnnotation(String name, Class<A> annotationType)
    Obtains the value annotation for the property on the object graph.
    Obtains the value type for the property on the object graph.
    retrieveValue(T object, String name)
    Retrieves the value from the object graph.
  • Method Details

    • retrieveValue

      Object retrieveValue(T object, String name) throws HttpException
      Retrieves the value from the object graph.
      Parameters:
      object - Root object of the object graph.
      name - Property name.
      Returns:
      Property value.
      Throws:
      HttpException - If fails to retrieve the value.
    • getValueType

      Class<?> getValueType(String name) throws HttpException
      Obtains the value type for the property on the object graph. It may be null indicating the path does not exist on the bean graph.
      Parameters:
      name - Property name.
      Returns:
      Value type. May be null if the path not exists.
      Throws:
      HttpException - If fails to determine if value is retrievable.
    • getValueAnnotation

      <A> A getValueAnnotation(String name, Class<A> annotationType) throws HttpException
      Obtains the value annotation for the property on the object graph. It may be null indicating either:
      • the path does not exist on the bean graph, or
      • no annotation by type for property
      Type Parameters:
      A - Annotation type.
      Parameters:
      name - Property name.
      annotationType - Annotation type.
      Returns:
      Annotation. May be null.
      Throws:
      HttpException - If fails to obtain annotation.