public TemplateCacheKey( final String ownerTemplate, final String template, final Set<String> templateSelectors, final int lineOffset, final int colOffset, final TemplateMode templateMode, final Map<String,Object> templateResolutionAttributes) { // NOTE we are assuming that templateSelectors is either null or a non-empty, naturally-ordered set. Also, // we are also assuming that templateResolutionAttributes is either null or non-empty. Also, BOTH // should be unmodifiable. This should have been sorted out at the TemplateSpec constructor. super(); // ownerTemplate will be null if this template is standalone (not something we are processing from inside another one like e.g. an inlining) Validate.notNull(template, "Template cannot be null"); // templateSelectors can be null if we are selecting the entire template // templateMode can be null if this template is standalone (no owner template) AND we are forcing a specific template mode for its processing // templateResolutionAttributes this.ownerTemplate = ownerTemplate; this.template = template; this.templateSelectors = templateSelectors; this.lineOffset = lineOffset; this.colOffset = colOffset; this.templateMode = templateMode; this.templateResolutionAttributes = templateResolutionAttributes; // This being a cache key, its equals and hashCode methods will potentially execute many // times, so this could help performance this.h = computeHashCode(); }