diff --git a/pebble/src/main/java/io/pebbletemplates/pebble/PebbleEngine.java b/pebble/src/main/java/io/pebbletemplates/pebble/PebbleEngine.java index 65e5481b5..648374a57 100644 --- a/pebble/src/main/java/io/pebbletemplates/pebble/PebbleEngine.java +++ b/pebble/src/main/java/io/pebbletemplates/pebble/PebbleEngine.java @@ -442,9 +442,10 @@ public Builder tagCache(PebbleCache tagCache) { } /** - * Sets whether or not escaping should be performed automatically. + * Sets whether or not escaping should be performed automatically. The default value of this + * setting is "true". * - * @param autoEscaping The auto escaping setting + * @param autoEscaping The auto escaping setting. * @return This builder object */ public Builder autoEscaping(boolean autoEscaping) { @@ -453,7 +454,8 @@ public Builder autoEscaping(boolean autoEscaping) { } /** - * Sets whether or not core operators overrides should be allowed. + * Sets whether or not core operators overrides should be allowed. The default value of this + * setting is "false". * * @param allowOverrideCoreOperators Whether or not core operators overrides should be allowed. * @return This builder object @@ -488,7 +490,7 @@ public Builder addEscapingStrategy(String name, EscapingStrategy strategy) { /** * Enable/disable all caches, i.e. cache used by the engine to store compiled PebbleTemplate - * instances and tags cache + * instances and tags cache. The default value of this setting is "true". * * @param cacheActive toggle to enable/disable all caches * @return This builder object diff --git a/pebble/src/main/java/io/pebbletemplates/pebble/attributes/AttributeResolver.java b/pebble/src/main/java/io/pebbletemplates/pebble/attributes/AttributeResolver.java index 94e2fe9e7..c94c72eeb 100644 --- a/pebble/src/main/java/io/pebbletemplates/pebble/attributes/AttributeResolver.java +++ b/pebble/src/main/java/io/pebbletemplates/pebble/attributes/AttributeResolver.java @@ -3,8 +3,25 @@ import io.pebbletemplates.pebble.node.ArgumentsNode; import io.pebbletemplates.pebble.template.EvaluationContextImpl; +/** + * Resolves instance attributes + */ public interface AttributeResolver { + /** + * Attempts to resolve an attribute of the given instance. If this method returns {@code null}, + * Pebble asks the next attribute resolver in the list. + * + * @param instance The object which is being accessed + * @param attributeNameValue The name of the attribute to resolve + * @param argumentValues fully evaluated positional arguments + * @param args The arguments + * @param context The evaluation context + * @param filename Filename of the template + * @param lineNumber the line number on which the expression is defined on. + * @return a {@link ResolvedAttribute} wrapping the attribute value, or {@code null} if the + * attribute could not be resolved + */ ResolvedAttribute resolve(Object instance, Object attributeNameValue, Object[] argumentValues, diff --git a/pebble/src/main/java/io/pebbletemplates/pebble/loader/Loader.java b/pebble/src/main/java/io/pebbletemplates/pebble/loader/Loader.java index aa53e9442..1ab23025d 100644 --- a/pebble/src/main/java/io/pebbletemplates/pebble/loader/Loader.java +++ b/pebble/src/main/java/io/pebbletemplates/pebble/loader/Loader.java @@ -25,7 +25,7 @@ public interface Loader { * The reader which will be used by Pebble to read the contents of the template. * * @param cacheKey the cache key to use to load create the reader. - * @return A reader object + * @return A reader object, or {@code null} if the template does not exist */ Reader getReader(T cacheKey);