org.apache.struts2.json

## Class JSONPopulator

- java.lang.Object
- - org.apache.struts2.json.JSONPopulator

-     public class JSONPopulator
      extends Object

  Isolate the process of populating JSON objects from the Interceptor class itself.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONPopulator()`
    `JSONPopulator(String dateFormat)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `convert(Class clazz, Type type, Object value, Method method)`
    `String` | `getDateFormat()`
    `void` | `populateObject(Object object, Map elements)`
    `void` | `setDateFormat(String dateFormat)`

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

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

- - ### Constructor Detail

    - #### JSONPopulator

          public JSONPopulator()

    - #### JSONPopulator

          public JSONPopulator(String dateFormat)

  - ### Method Detail

    - #### getDateFormat

          public String getDateFormat()

    - #### setDateFormat

          public void setDateFormat(String dateFormat)

    - #### populateObject

          public void populateObject(Object object,
                                     Map elements)
                              throws IllegalAccessException,
                                     InvocationTargetException,
                                     NoSuchMethodException,
                                     IntrospectionException,
                                     IllegalArgumentException,
                                     JSONException,
                                     InstantiationException

      Throws:
        `IllegalAccessException`
        `InvocationTargetException`
        `NoSuchMethodException`
        `IntrospectionException`
        `IllegalArgumentException`
        `JSONException`
        `InstantiationException`

    - #### convert

          public Object convert(Class clazz,
                                Type type,
                                Object value,
                                Method method)
                         throws IllegalArgumentException,
                                JSONException,
                                IllegalAccessException,
                                InvocationTargetException,
                                InstantiationException,
                                NoSuchMethodException,
                                IntrospectionException

      Throws:
        `IllegalArgumentException`
        `JSONException`
        `IllegalAccessException`
        `InvocationTargetException`
        `InstantiationException`
        `NoSuchMethodException`
        `IntrospectionException`

Copyright © 2000–2023 Apache Software Foundation. All rights reserved.