Interface TemplateVisitor<T,​C>

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default T visitAny​(C context)
      Fallback method if the visitor does not implement the other visit methods.
      default T visitEmpty​(C context)
      Visit an empty template with the given context object.
      default T visitProperty​(C context, Template property, Template defaultValue)
      Visit a property template with the given context object.
      default T visitSequence​(C context, List<Template> sequence)
      Visit a sequence of templates with the given context object.
      default T visitText​(C context, String text)
      Visit a textual template with the given context object.
    • Method Detail

      • visitText

        default T visitText​(C context,
                            String text)
        Visit a textual template with the given context object.
        Parameters:
        context - the contextual object (can be null)
        text - the text contained in the visited textual template
        Returns:
        the result of the operation on the template
      • visitEmpty

        default T visitEmpty​(C context)
        Visit an empty template with the given context object.
        Parameters:
        context - the contextual object (can be null)
        Returns:
        the result of the operation on the template
      • visitProperty

        default T visitProperty​(C context,
                                Template property,
                                Template defaultValue)
        Visit a property template with the given context object.
        Parameters:
        context - the contextual object (can be null)
        property - the template that defines the property's name
        defaultValue - the template that defines the property's default value
        Returns:
        the result of the operation on the template
      • visitSequence

        default T visitSequence​(C context,
                                List<Template> sequence)
        Visit a sequence of templates with the given context object.
        Parameters:
        context - the contextual object (can be null)
        sequence - the (never null) list of templates within this sequence
        Returns:
        the result of the operation on the template
      • visitAny

        default T visitAny​(C context)
        Fallback method if the visitor does not implement the other visit methods.
        Parameters:
        context - the contextual object (can be null)
        Returns:
        the result of the operation on the template