Class AbstractValueExtractor

java.lang.Object
microsim.reflection.AbstractValueExtractor
Direct Known Subclasses:
DoubleValueExtractor, IntegerValueExtractor, LongValueExtractor, StringValueExtractor

public abstract class AbstractValueExtractor extends Object
Employs Java reflection to call objects' methods which return values of the corresponding type, or to extract field values directly.
  • Field Details

    • method

      protected Method method
    • field

      protected Field field
    • target

      protected Object 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 - when target, or fieldName, or both are null.
    • 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 - when target, or fieldName, or both are null.