Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#471 Allow flexible concrete type resolution #474

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Mar 2, 2022

  1. feat: introduce TypeResolver API

    Introduces a new `TypeResolver` interface to the public API. This
    interface's default implementation is in `ReflectionUtils`, which
    is then delegated to the static helpers in `ClassGraphFacade`. This
    means the new feature remains backwards compatible with previous
    behavior.
    
    Users can now specify a new parameter,
    `EasyRandomParameters#typeResolver(TypeResolver)`, which lets them
    specify how concrete types will be resolved without coupling the
    library to `ClassGraph` in any way, though users can still use
    `ClassGraph` to implement it themselves.
    
    An internal proxy class is used to wrap custom instances of
    `TypeResolver` set via the parameters. This is mostly because when
    creating the default `ObjenesisObjectFactory`, we need to pass it the
    current type resolver. However, it may get modified later on. So
    instead, we pass a proxy, which we can always modify thereafter. The
    proxy is not accessible to the user, so the only way to modify it is via
    the parameters.
    npepinpe committed Mar 2, 2022
    Configuration menu
    Copy the full SHA
    9324e58 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    55b8eff View commit details
    Browse the repository at this point in the history