Annotation Type DataAccessPath


  • @Documented
    @Retention(RUNTIME)
    @Target(METHOD)
    public @interface DataAccessPath
    Methods in a data accessor annotated with DataAccessPath access their data according to that path.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String value
      A path representing the chain of calls required to extract the data being accessed.
    • Element Detail

      • value

        java.lang.String value
        A path representing the chain of calls required to extract the data being accessed. For example the value "getFoo()/getBar()" would call getFoo() on the interception target, and then call getBar() on the result of the getFoo() call (without having to know its type). The result produced at the end of this chain of calls, if any, is then provided as the return value of the instrumented method. Parameters can also be supplied on the DataAccessPath, when the called methods do not have bean-like getter semantics. For example, consider the DataAccessPath required to call Bar::getSomethingByName, given an Accessor created for Bar: class Bar { getSomethingByName(String name); } class Foo { getBarByIndex(int index); } class FooAccessor { @DataAccessPath("getBarByIndex(0)/getSomethingByName(1)") getSomething(int index, String name); } The annotation on getSomething() first calls getBarByIndex with the 0th argument of getSomething(), then, on the result of that call (which is an object of type Bar), calls getSomethingByName with the 1st argument of getSomething().
        Returns:
        the data path