Class ReflectiveTypeAdapterFactory.BoundField

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.reflect.Field field  
      (package private) java.lang.String fieldName
      Name of the underlying field
      (package private) java.lang.String serializedName
      Name used for serialization (but not for deserialization)
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BoundField​(java.lang.String serializedName, java.lang.reflect.Field field)  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      (package private) abstract void readIntoArray​(JsonReader reader, int index, java.lang.Object[] target)
      Read the value into the target array, used to provide constructor arguments for records
      (package private) abstract void readIntoField​(JsonReader reader, java.lang.Object target)
      Read the value from the reader, and set it on the corresponding field on target via reflection
      (package private) abstract void write​(JsonWriter writer, java.lang.Object source)
      Read this field value from the source, and append its JSON value to the writer
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serializedName

        final java.lang.String serializedName
        Name used for serialization (but not for deserialization)
      • field

        final java.lang.reflect.Field field
      • fieldName

        final java.lang.String fieldName
        Name of the underlying field
    • Constructor Detail

      • BoundField

        protected BoundField​(java.lang.String serializedName,
                             java.lang.reflect.Field field)
    • Method Detail

      • write

        abstract void write​(JsonWriter writer,
                            java.lang.Object source)
                     throws java.io.IOException,
                            java.lang.IllegalAccessException
        Read this field value from the source, and append its JSON value to the writer
        Throws:
        java.io.IOException
        java.lang.IllegalAccessException
      • readIntoArray

        abstract void readIntoArray​(JsonReader reader,
                                    int index,
                                    java.lang.Object[] target)
                             throws java.io.IOException,
                                    JsonParseException
        Read the value into the target array, used to provide constructor arguments for records
        Throws:
        java.io.IOException
        JsonParseException
      • readIntoField

        abstract void readIntoField​(JsonReader reader,
                                    java.lang.Object target)
                             throws java.io.IOException,
                                    java.lang.IllegalAccessException
        Read the value from the reader, and set it on the corresponding field on target via reflection
        Throws:
        java.io.IOException
        java.lang.IllegalAccessException