Interface ViewBuilder


  • public interface ViewBuilder
    Builds a JsonView.
    • Method Detail

      • beginObject

        void beginObject​(String name,
                         MethodHandle methodHandle)
        Begin a json object.
      • add

        void add​(String name,
                 JsonAdapter<?> adapter,
                 MethodHandle methodHandle)
        Add a json property entry.
        Parameters:
        name - The name of the json property.
        adapter - The adapter used for the property.
        methodHandle - The MethodHandle of the "getter/accessor" for the property.
      • endObject

        void endObject()
        End a json object.
      • field

        MethodHandle field​(Class<?> cls,
                           String name)
        Return a MethodHandle for public field access for the given class and field name.
      • method

        MethodHandle method​(Class<?> cls,
                            String methodName,
                            Class<?> returnType)
        Return a MethodHandle for the "getter/accessor" for the given class and field name.