/** * <p> * Lazily resolve the value. * </p> * <p> * This will be transparently called by the Thymeleaf engine at template rendering time when an object * of this class is resolved in a Thymeleaf expression. * </p> * <p> * Note lazy variables will be resolved just once, and their resolved values will be reused as many times * as they appear in the template. * </p> * * @return the resolved value. */ public final T getValue() { if (!this.initialized) { synchronized (this) { if (!this.initialized) { this.value = loadValue(); this.initialized = true; } } } return this.value; }
public LazyContextVariable adapt(String key, final Object extractedValue) { if (key.equals(Attributes.ALLTAGS)) { return new LazyContextVariable<Set<?>>() { @Override protected Set<?> loadValue() { return new LazyContextVariable<Date>() { @Override protected Date loadValue() { return new LazyContextVariable<Object>() { @Override protected Object loadValue() { }).getValue(); } catch (NoModelExtractorException e) { return "";
public LazyContextVariable adapt(String key, final Object extractedValue) { if (key.equals(Attributes.ALLTAGS)) { return new LazyContextVariable<Set<?>>() { @Override protected Set<?> loadValue() { return new LazyContextVariable<Date>() { @Override protected Date loadValue() { return new LazyContextVariable<Object>() { @Override protected Object loadValue() { }).getValue(); } catch (NoModelExtractorException e) { return "";