Class CallableActorHelper

    • Constructor Detail

      • CallableActorHelper

        public CallableActorHelper()
    • Method Detail

      • findCallableActor

        public Actor findCallableActor​(ActorReferenceHandler handler,
                                       CallableActorReference name)
        Checks a reference handler's children whether they contain the callable actor that we're looking for.
        Parameters:
        handler - the reference handler to check
        name - the name of the callable actor
        Returns:
        the callable actor or null if not found
      • findCallableActor

        public Actor findCallableActor​(ActorHandler handler,
                                       CallableActorReference name)
        Checks a control actor's children whether they contain the callable actor that we're looking for.
        Parameters:
        handler - the handler to check
        name - the name of the callable actor
        Returns:
        the callable actor or null if not found
      • findCallableActor

        public Actor findCallableActor​(Actor root,
                                       CallableActorReference name)
        Tries to find the callable actor referenced by its name.
        Parameters:
        root - the root to search in
        name - the name of the callable actor
        Returns:
        the callable actor or null if not found
      • findCallableActorRecursive

        public Actor findCallableActorRecursive​(Actor actor,
                                                CallableActorReference name)
        Tries to find the referenced callable actor. First all possible actor handlers are located recursively (up to the root) that allow also singletons. This list of actors is then searched for the callable actor.
        Parameters:
        actor - the actor to start from
        name - the name of the callable actor
        Returns:
        the callable actor or null if not found
        See Also:
        ActorUtils.findActorHandlers(Actor, boolean)
      • findCallableActors

        protected void findCallableActors​(ActorReferenceHandler handler,
                                          List<Actor> collected)
        Locates callable actors.
        Parameters:
        handler - the handler to check
        collected - the actors collected so far
      • findCallableActors

        protected void findCallableActors​(ActorHandler handler,
                                          List<Actor> collected)
        Locates callable actors.
        Parameters:
        handler - the handler to check
        collected - the actors collected so far
      • findCallableActorsRecursive

        public List<Actor> findCallableActorsRecursive​(Actor actor)
        Locates all callable actors .
        Parameters:
        actor - the actor to start from
        Returns:
        the callable actors
      • findMultiView

        public Actor findMultiView​(ActorHandler handler,
                                   CallableActorReference name)
        Checks a control actor's children whether they contain the multi-view actor that we're looking for.
        Parameters:
        handler - the handler to check
        name - the name of the callable actor
        Returns:
        the callable actor or null if not found
      • findMultiViewRecursive

        public Actor findMultiViewRecursive​(Actor actor,
                                            CallableActorReference name)
        Tries to find the referenced multi-view actor. First all possible actor handlers are located recursively (up to the root) that allow also singletons. This list of actors is then searched for the multi-view actor.
        Parameters:
        actor - the actor to start from
        name - the name of the callable actor
        Returns:
        the callable actor or null if not found
        See Also:
        ActorUtils.findActorHandlers(Actor, boolean)
      • getSetup

        protected static Object getSetup​(Class cls,
                                         CallableActorReference name,
                                         Actor start,
                                         AbstractCallableActor callable,
                                         MessageCollection errors)
        Returns the setup obtained from the callable actor, source or transformer. In the latter case, the transformer must output a setup if no input token is provided.
        Parameters:
        cls - the class that the output must match, null to ignore
        name - the callable actor referenced
        start - where the search starts from
        callable - the callable actor (source or transformer) to use
        errors - for storing any errors
        Returns:
        the setup, null if not found or didn't match class
      • getSetup

        public static Object getSetup​(Class cls,
                                      CallableActorReference name,
                                      Actor start,
                                      MessageCollection errors)
        Returns the setup obtained from the callable actor, source or transformer. In the latter case, the transformer must output a setup if no input token is provided.
        Parameters:
        cls - the class that the output must match, null to ignore
        name - the callable actor referenced
        start - where the search starts from
        errors - for storing any errors
        Returns:
        the setup, null if not found or didn't match class
      • getSetupFromSource

        public static Object getSetupFromSource​(Class cls,
                                                CallableActorReference name,
                                                Actor start,
                                                MessageCollection errors)
        Returns the setup obtained from the callable source.
        Parameters:
        cls - the class that the output must match, null to ignore
        name - the callable actor referenced
        start - where the search starts from
        errors - for storing any errors
        Returns:
        the setup, null if not found or didn't match class
      • getSetupFromTransformer

        public static Object getSetupFromTransformer​(Class cls,
                                                     CallableActorReference name,
                                                     Actor start,
                                                     MessageCollection errors)
        Returns the setup obtained from the callable transformer. The transformer must output a setup if no input token is provided.
        Parameters:
        cls - the class that the output must match, null to ignore
        name - the callable actor referenced
        start - where the search starts from
        Returns:
        the setup, null if not found or didn't match class
      • findAllCallableActors

        public static List<Actor> findAllCallableActors​(Actor flow)
        Returns all CallableActors instances that can be located in the flow
        Parameters:
        flow - the flow to use
        Returns:
        the CallableActors instances
      • createCallableActors

        public static CallableActors createCallableActors​(Actor actor,
                                                          boolean insert)
        Returns the CallableActors instance. Can insert one if required.
        Parameters:
        actor - the actor to start the search from
        insert - whether to insert a CallableActors instance if none present
        Returns:
        the CallableActors instance, null in case of error
      • createCallableActor

        public static Actor createCallableActor​(Actor actor)
        Turns the specified actor into a callable actor.
        Parameters:
        actor - the actor to turn into a callable actor
        Returns:
        the replacement actor (CallableSink etc.), null in case of error