接口 ConstructorExecutor

  • 所有已知实现类:
    ReflectiveConstructorExecutor

    public interface ConstructorExecutor
    Executors are built by resolvers and can be cached by the infrastructure to repeat an operation quickly without going back to the resolvers. For example, the particular constructor to run on a class may be discovered by the reflection constructor resolver - it will then build a ConstructorExecutor that executes that constructor and the ConstructorExecutor can be reused without needing to go back to the resolver to discover the constructor again.

    They can become stale, and in that case should throw an AccessException - this will cause the infrastructure to go back to the resolvers to ask for a new one.

    从以下版本开始:
    3.0
    作者:
    Andy Clement
    • 方法详细资料

      • execute

        TypedValue execute​(EvaluationContext context,
                           Object... arguments)
                    throws AccessException
        Execute a constructor in the specified context using the specified arguments.
        参数:
        context - the evaluation context in which the command is being executed
        arguments - the arguments to the constructor call, should match (in terms of number and type) whatever the command will need to run
        返回:
        the new object
        抛出:
        AccessException - if there is a problem executing the command or the CommandExecutor is no longer valid