public class BeanVisitor extends Object
Visit and modify bean's field by reflection, mainly used for property formatting. Bean means the object with `Declared` field and its getter(isXxx/getXxx/xxx) Ignore `final`/`transient` fields and `@Transient` getters A final with an initial value is inline at compile time, and modifying it does not change the return value of the getter Initializing final values with the constructor does not have this restriction. See JLS 17.5.3 compile-time constants get inlined The visit ends if one of the following conditions is true, - no bean to visit, - has been visited, - the visit depth is reached. The original is modified to the `return` value if the `return` is primitive type or not same as the original ref, and not `null`. If the original value is of the following types and not modified, then visit its element - Object[]: element - Map: Value object - Iterable - element
| Modifier and Type | Class and Description |
|---|---|
static class |
BeanVisitor.ContainerVisitor
Recursively handle common containers with empty constructor, eg.
|
static class |
BeanVisitor.Fd |
static class |
BeanVisitor.Opt |
static interface |
BeanVisitor.Vzt |
| Constructor and Description |
|---|
BeanVisitor() |
| Modifier and Type | Method and Description |
|---|---|
static void |
visit(@Nullable BeanVisitor.Opt opt,
@Nullable Object bean,
BeanVisitor.Vzt... vzts) |
static void |
visit(@Nullable BeanVisitor.Opt opt,
@Nullable Object bean,
@Nullable Collection<BeanVisitor.Vzt> visitors) |
static void |
visit(@Nullable Object bean,
BeanVisitor.Vzt... vzts) |
static void |
visit(@Nullable Object bean,
@Nullable Collection<BeanVisitor.Vzt> visitors) |
public static void visit(@Nullable
@Nullable Object bean,
BeanVisitor.Vzt... vzts)
public static void visit(@Nullable
@Nullable Object bean,
@Nullable
@Nullable Collection<BeanVisitor.Vzt> visitors)
public static void visit(@Nullable
@Nullable BeanVisitor.Opt opt,
@Nullable
@Nullable Object bean,
BeanVisitor.Vzt... vzts)
public static void visit(@Nullable
@Nullable BeanVisitor.Opt opt,
@Nullable
@Nullable Object bean,
@Nullable
@Nullable Collection<BeanVisitor.Vzt> visitors)
Copyright © 2024. All rights reserved.