接口 ReflectiveModel<T extends ReflectiveModel<T>>
-
- 类型参数:
T- Recursive generic type of the class implementing this interface.
- 所有超级接口:
Model
- 所有已知实现类:
ClassLoaderModel,ClassModel
public interface ReflectiveModel<T extends ReflectiveModel<T>> extends Model
A mixin fully implementing theModelinterface, so that the classes implementing the model don't have to do it themselves. This mixin assumes, that the class implementing it follows these rules:- Has a constructor with no arguments (can be private) that will be used for creating instances for static methods, constructors and instance methods with unknown values
- Uses
ModeledConstructor,ModeledStaticMethodandModeledInstanceMethodto mark the model methods. These methods should be private.
All annotated methods should take
ModelHelper.MethodExecutionContextas the first argument, the remaining arguments areValuearguments where their number corresponds to the number of arguments the modelled method expects.
-
-
字段概要
字段 修饰符和类型 字段 说明 static org.apache.logging.log4j.Loggerlog
-
方法概要
所有方法 实例方法 默认方法 修饰符和类型 方法 说明 default MethodResultinit(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)Execute a constructor call for the modeled class.default MethodResultinvoke(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)Execute an instance method on the modeled object.default MethodResultinvokeStatic(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)Execute a static method for the modeled class.
-
-
-
方法详细资料
-
init
default MethodResult init(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)
从接口复制的说明:ModelExecute a constructor call for the modeled class.It is suggested to add logic to allow running this only on a dummy model without any state.
- 指定者:
init在接口中Model- 参数:
methodExecutionInfo- execution info of the target method.valueCalculator- the value calculator that should be used to create any value in the result.- 返回:
- the result of the method invocation. Since it's a constructor invocation the return value of the result is expected to be empty and the constructed value should be set as the updated instance.
-
invoke
default MethodResult invoke(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)
从接口复制的说明:ModelExecute an instance method on the modeled object. The state of the instance is represented by the state of the model.It is suggested to add logic to allow running this only on a model representing an initialized object.
-
invokeStatic
default MethodResult invokeStatic(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)
从接口复制的说明:ModelExecute a static method for the modeled class.It is suggested to add logic to allow running this only on a dummy model without any state.
- 指定者:
invokeStatic在接口中Model- 参数:
methodExecutionInfo- execution info of the target method.valueCalculator- the value calculator that should be used to create any value in the result.- 返回:
- the result of the method invocation.
-
-