/** * <p> * Returns the name of the template resolver * </p> * * @return the name of the template resolver */ public String getName() { checkInitialized(); return this.name; }
/** * <p> * Returns the order in which this template resolver will be asked to resolve * templates as a part of the chain of resolvers configured into the template engine. * </p> * <p> * Order should start with 1. * </p> * * @return the order in which this template resolver will be called in the chain. */ public Integer getOrder() { checkInitialized(); return this.order; }
/** * <p> * Returns the <i>pattern spec</i> specified for establishing which * templates can be resolved by this template resolver. For those templates * which names do not match this patterns, the Template Resolver will return null. * </p> * <p> * This allows for a fast discard of those templates that the developer might * know for sure that will not be resolvable by the Resource Resolver used by * this Template Resolver, so that an execution of the resource resolver is not needed. * </p> * * @return the pattern spec */ public PatternSpec getResolvablePatternSpec() { checkInitialized(); return this.resolvablePatternSpec; }
/** * <p> * Returns the <i>patterns</i> (as String) specified for establishing which * templates can be resolved by this template resolver. For those templates * which names do not match this patterns, the Template Resolver will return null. * </p> * <p> * This allows for a fast discard of those templates that the developer might * know for sure that will not be resolvable by the Resource Resolver used by * this Template Resolver, so that an execution of the resource resolver is not needed. * </p> * <p> * This is a convenience method equivalent to {@link #getResolvablePatternSpec()}.getPatterns() * </p> * * @return the pattern spec */ public Set<String> getResolvablePatterns() { checkInitialized(); return this.resolvablePatternSpec.getPatterns(); }
public TemplateResolution resolveTemplate(final TemplateProcessingParameters templateProcessingParameters) { checkInitialized(); Validate.notNull(templateProcessingParameters, "Template Processing Parameters cannot be null"); if (!computeResolvable(templateProcessingParameters)) { return null; } return new TemplateResolution( templateProcessingParameters.getTemplateName(), computeResourceName(templateProcessingParameters), computeResourceResolver(templateProcessingParameters), computeCharacterEncoding(templateProcessingParameters), computeTemplateMode(templateProcessingParameters), computeValidity(templateProcessingParameters)); }