Class TemplateRepresentation.ResolverContext

  • All Implemented Interfaces:
    org.apache.velocity.context.Context
    Enclosing class:
    TemplateRepresentation

    private class TemplateRepresentation.ResolverContext
    extends java.lang.Object
    implements org.apache.velocity.context.Context
    Velocity context based on a Resolver.
    See Also:
    Resolver
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Resolver<? extends java.lang.Object> resolver
      The inner resolver instance.
    • Constructor Summary

      Constructors 
      Constructor Description
      ResolverContext​(Resolver<? extends java.lang.Object> resolver)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.String key)  
      java.lang.Object get​(java.lang.String key)
      Gets the value corresponding to the provided key from the context.
      java.lang.String[] getKeys()
      Returns null since a resolver does not know by advance the whole values.
      java.lang.Object put​(java.lang.String key, java.lang.Object value)
      Returns null since a resolver as a data model cannot be updated.
      java.lang.Object remove​(java.lang.String key)
      Does nothing since resolver as a data model cannot be updated.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • resolver

        private final Resolver<? extends java.lang.Object> resolver
        The inner resolver instance.
    • Constructor Detail

      • ResolverContext

        public ResolverContext​(Resolver<? extends java.lang.Object> resolver)
        Constructor.
        Parameters:
        resolver - The resolver.
    • Method Detail

      • containsKey

        public boolean containsKey​(java.lang.String key)
        Specified by:
        containsKey in interface org.apache.velocity.context.Context
      • get

        public java.lang.Object get​(java.lang.String key)
        Gets the value corresponding to the provided key from the context.
        Specified by:
        get in interface org.apache.velocity.context.Context
      • getKeys

        public java.lang.String[] getKeys()
        Returns null since a resolver does not know by advance the whole values.
        Specified by:
        getKeys in interface org.apache.velocity.context.Context
      • put

        public java.lang.Object put​(java.lang.String key,
                                    java.lang.Object value)
        Returns null since a resolver as a data model cannot be updated.
        Specified by:
        put in interface org.apache.velocity.context.Context
        Parameters:
        key - The name to key the provided value with.
        value - The corresponding value.
        Returns:
        null.
      • remove

        public java.lang.Object remove​(java.lang.String key)
        Does nothing since resolver as a data model cannot be updated.
        Specified by:
        remove in interface org.apache.velocity.context.Context
        Parameters:
        value - The name of the value to remove.
        Returns:
        null.