Class StandardGenerator

    • Method Detail

      • getRenderStack

        public RenderStack getRenderStack()
        Description copied from interface: Generator
        Returns the current rendering stack. The top element will be the one most recent rendered and the bottom one will be the element that was first passed to the generator. Elements are removed from the stack once they have finished rendering.

        If an element needs to access its parent, it can call this method and peek on the second element from the top.

        Specified by:
        getRenderStack in interface Generator
        Returns:
        the current rendering stack
        See Also:
        RenderStack
      • metaOn

        public <A,​B> Stream<Meta<A,​B>> metaOn​(A from,
                                                          Class<B> to)
        Description copied from interface: Generator
        Renders the specified model into a stream of code models. This is used internally to provide the other interface methods.
        Specified by:
        metaOn in interface Generator
        Type Parameters:
        A - the input type
        B - the expected output type
        Parameters:
        from - the model to generate
        to - the model type to transform to
        Returns:
        a stream of meta objects
        See Also:
        Meta
      • transform

        public <A,​B> Optional<Meta<A,​B>> transform​(Transform<A,​B> transform,
                                                               A model,
                                                               TransformFactory factory)
        Description copied from interface: Generator
        Transforms the specified model using the specified Transform from the specified TransformFactory.
        Specified by:
        transform in interface Generator
        Type Parameters:
        A - the input type
        B - the expected output type
        Parameters:
        transform - the transform to use
        model - the inputed model
        factory - the factory used when instantiating the transform
        Returns:
        the meta object if successful, else empty
        See Also:
        Transform, TransformFactory