public final class PojoIntrospector extends Object
Objects
using arguments in serialized form.
String s =
Constructor and Description |
---|
PojoIntrospector(Object o)
Shortcut for calling
|
PojoIntrospector(Object o,
ReaderParser p)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
invokeMethod(Method method,
Reader args)
Primary method.
|
Object |
invokeMethod(String method,
String args)
Convenience method for invoking argument from method signature (@see
MethodInfo.getSignature() . |
public PojoIntrospector(Object o, ReaderParser p)
o
- The object on which Java methods will be invoked.p
- The parser to use to parse the method arguments.
If JsonParser.DEFAULT
is used.public PojoIntrospector(Object o)
new PojoIntrospector(o, null );
o
- The object on which Java methods will be invoked.public Object invokeMethod(Method method, Reader args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, ParseException, IOException
Invokes the specified method on this bean.
method
- The method being invoked.args
- The arguments to pass as parameters to the method.
These will automatically be converted to the appropriate object type if possible.
Can be IllegalAccessException
- If the IllegalArgumentException
- If one of the following occurs:
InvocationTargetException
- If the underlying constructor throws an exception.ParseException
- Malformed input encountered.IOException
- Thrown by underlying stream.public Object invokeMethod(String method, String args) throws NoSuchMethodException, IllegalArgumentException, InvocationTargetException, IllegalAccessException, ParseException, IOException
MethodInfo.getSignature()
.method
- The method being invoked.args
- The arguments to pass as parameters to the method.
These will automatically be converted to the appropriate object type if possible.
Can be NoSuchMethodException
- If method does not exist.IllegalAccessException
- If the IllegalArgumentException
- If one of the following occurs:
InvocationTargetException
- If the underlying constructor throws an exception.ParseException
- Malformed input encountered.IOException
- Thrown by underlying stream.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.