Package org.apache.juneau.objecttools
Class ObjectViewer
java.lang.Object
org.apache.juneau.objecttools.ObjectViewer
- All Implemented Interfaces:
ObjectTool<ViewArgs>
POJO model viewer.
This class is designed to extract properties from collections of maps or beans.
Example:
MyBean[]
The tool can be used against the following data types:
- Arrays/collections of maps or beans.
- Singular maps or beans.
See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectViewer
create()
Static creator.Runs this viewer on the specified collection or array of objects.run
(BeanSession session, Object input, ViewArgs args) Converts the specified input to some other output.Runs this viewer on a singleton object.
-
Field Details
-
DEFAULT
Default reusable searcher.
-
-
Constructor Details
-
ObjectViewer
public ObjectViewer()
-
-
Method Details
-
create
Static creator.- Returns:
- A new
ObjectViewer
object.
-
run
Runs this viewer on the specified collection or array of objects.- Parameters:
input
- The input. Must be an array or collection.args
- The view args. SeeViewArgs
for format.- Returns:
- The extracted properties from the collection of objects.
-
runSingle
Runs this viewer on a singleton object.- Parameters:
input
- The input. Must be a singleton object.args
- The view args. SeeViewArgs
for format.- Returns:
- The extracted properties from the object.
-
run
Description copied from interface:ObjectTool
Converts the specified input to some other output.- Specified by:
run
in interfaceObjectTool<ViewArgs>
- Parameters:
session
- The current bean session.input
- The input POJO.args
- The arguments.- Returns:
- The output POJO.
-