com.vaadin.flow.templatemodel.

Class TemplateModelProxyHandler

    • Method Detail

      • intercept

        @RuntimeType
        public Object intercept(@This
                                             Object target,
                                             @Origin
                                             Method method,
                                             @AllArguments
                                             Object[] args)

        Processes a method invocation on a Byte buddy proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.

        Parameters:

        target - the proxy instance

        method - the Method instance corresponding to the proxied method invoked on the proxy instance.

        args - an array of objects containing the values of the arguments passed in the method invocation on the proxy instance.

        Returns:

        the value to return from the method invocation on the proxy instance.

      • createModelProxy

        public static <T> T createModelProxy(StateNode stateNode,
                                             BeanModelType<T> modelType)

        Creates a proxy object for the given modelType type for the given state node.

        Type Parameters:

        T - the proxy type

        Parameters:

        stateNode - the state node, not null

        modelType - the type of the model, not null

        Returns:

        a proxy object, not null

      • getStateNodeForProxy

        public static StateNode getStateNodeForProxy(Object proxy)

        Gets the state node that a proxy is bound to.

        Parameters:

        proxy - the template model proxy

        Returns:

        the state node of the proxy

      • getModelTypeForProxy

        public static BeanModelType<?> getModelTypeForProxy(Object proxy)

        Gets the model type that a proxy instance is bound to.

        Parameters:

        proxy - the template model proxy

        Returns:

        the model type of the proxy

      • isProxy

        public static boolean isProxy(Object proxy)

        Checks if the given object is a proxy created by this class.

        Parameters:

        proxy - the object to check

        Returns:

        true if the given object is a proxy object, false otherwise