Class TemplateRequestURLBuilder

    • Field Detail

      • CONTEXT_KEY_ENTITY_ID

        public static final String CONTEXT_KEY_ENTITY_ID
        The Velocity context variable name for the entity ID.
        See Also:
        Constant Field Values
      • log

        private final org.slf4j.Logger log
        Logger.
      • template

        private Template template
        Velocity template instance used to render the request URL.
      • templateText

        private String templateText
        The template text, for logging purposes.
      • transformer

        private Function<String,​String> transformer
        Function which transforms the entityID prior to substitution into the template.
    • Constructor Detail

      • TemplateRequestURLBuilder

        public TemplateRequestURLBuilder​(@Nonnull
                                         org.apache.velocity.app.VelocityEngine engine,
                                         @Nonnull @NotEmpty
                                         String templateString,
                                         @Nullable
                                         TemplateRequestURLBuilder.EncodingStyle encodingStyle)
        Constructor.

        The template character set will be US ASCII.

        Parameters:
        engine - the VelocityEngine instance to use
        templateString - the Velocity template string
        encodingStyle - the style for encoding the entity ID prior to substitution, null means TemplateRequestURLBuilder.EncodingStyle.none
      • TemplateRequestURLBuilder

        public TemplateRequestURLBuilder​(@Nonnull
                                         org.apache.velocity.app.VelocityEngine engine,
                                         @Nonnull @NotEmpty
                                         String templateString,
                                         @Nullable
                                         TemplateRequestURLBuilder.EncodingStyle encodingStyle,
                                         @Nullable
                                         Function<String,​String> transform)
        Constructor.

        The template character set will be US ASCII.

        Parameters:
        engine - the VelocityEngine instance to use
        templateString - the Velocity template string
        transform - function which transforms the entityID prior to substitution, may be null
        encodingStyle - the style for encoding the entity ID prior to substitution, null means TemplateRequestURLBuilder.EncodingStyle.none
      • TemplateRequestURLBuilder

        public TemplateRequestURLBuilder​(@Nonnull
                                         org.apache.velocity.app.VelocityEngine engine,
                                         @Nonnull @NotEmpty
                                         String templateString,
                                         TemplateRequestURLBuilder.EncodingStyle encodingStyle,
                                         @Nullable
                                         Function<String,​String> transform,
                                         @Nullable
                                         Charset charSet)
        Constructor.
        Parameters:
        engine - the VelocityEngine instance to use
        templateString - the Velocity template string
        encodingStyle - the style for encoding the entity ID prior to substitution, null means TemplateRequestURLBuilder.EncodingStyle.none
        transform - function which transforms the entityID prior to substitution, may be null
        charSet - character set of the template, may be null