Package microsim.reflection
Class AbstractValueExtractor
java.lang.Object
microsim.reflection.AbstractValueExtractor
- Direct Known Subclasses:
DoubleValueExtractor
,IntegerValueExtractor
,LongValueExtractor
,StringValueExtractor
Employs Java reflection to call objects' methods which return values of the corresponding type, or to extract field
values directly.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractValueExtractor
(@NonNull Object target, @NonNull String fieldName, boolean isMethod) Constructor.AbstractValueExtractor
(@Nullable Class<?> target, @NonNull String fieldName, boolean isMethod) Constructor. -
Method Summary
-
Field Details
-
method
-
field
-
target
-
-
Constructor Details
-
AbstractValueExtractor
public AbstractValueExtractor(@NonNull @NonNull Object target, @NonNull @NonNull String fieldName, boolean isMethod) Constructor.- Parameters:
target
- The target object.fieldName
- A string representing the name of the method to invoke.isMethod
- If true the fieldName is a method, otherwise it is a property of the object.- Throws:
NullPointerException
- whentarget
, orfieldName
, or both arenull
.
-
AbstractValueExtractor
public AbstractValueExtractor(@Nullable @Nullable Class<?> target, @NonNull @NonNull String fieldName, boolean isMethod) Constructor.- Parameters:
target
- The class of the target object.fieldName
- A string representing the name of the method to invoke.isMethod
- If true the fieldName is a method, otherwise it is a property of the object.- Throws:
NullPointerException
- whentarget
, orfieldName
, or both arenull
.
-