/** * Execute the mustache object with a given writer and a single scope context. * * @param writer write the output of the executed template here * @param scope the root object to use * @return the new writer */ default Writer execute(Writer writer, Object scope) { return execute(writer, makeList(scope)); }
@Override public boolean apply(List<Object> objects) { Object scope = unwrap(oh, index, wrappers, objects); for (Guard predicate : wrapperGuard) { if (!predicate.apply(makeList(scope))) { return false; } } return true; }
public static Object unwrap(ObjectHandler oh, int scopeIndex, Wrapper[] wrappers, List<Object> scopes) throws GuardException { Object scope = oh.coerce(scopes.get(scopeIndex)); // The value may be buried by . notation if (wrappers != null) { for (Wrapper wrapper : wrappers) { scope = oh.coerce(wrapper.call(ObjectHandler.makeList(scope))); } } return scope; }
try { scope = coerce(wrapper.call(ObjectHandler.makeList(coerce(scope)))); } catch (GuardException e) { throw new AssertionError(e);
/** * Execute the mustache object with a given writer and a single scope context. * * @param writer write the output of the executed template here * @param scope the root object to use * @return the new writer */ default Writer execute(Writer writer, Object scope) { return execute(writer, makeList(scope)); }
/** * Execute the mustache object with a given writer and a single scope context. * * @param writer write the output of the executed template here * @param scope the root object to use * @return the new writer */ default Writer execute(Writer writer, Object scope) { return execute(writer, makeList(scope)); }
@Override public boolean apply(List<Object> objects) { Object scope = unwrap(oh, index, wrappers, objects); for (Guard predicate : wrapperGuard) { if (!predicate.apply(makeList(scope))) { return false; } } return true; }
@Override public boolean apply(List<Object> objects) { Object scope = unwrap(oh, index, wrappers, objects); for (Guard predicate : wrapperGuard) { if (!predicate.apply(makeList(scope))) { return false; } } return true; }
public static Object unwrap(ObjectHandler oh, int scopeIndex, Wrapper[] wrappers, List<Object> scopes) throws GuardException { Object scope = oh.coerce(scopes.get(scopeIndex)); // The value may be buried by . notation if (wrappers != null) { for (Wrapper wrapper : wrappers) { scope = oh.coerce(wrapper.call(ObjectHandler.makeList(scope))); } } return scope; }
public static Object unwrap(ObjectHandler oh, int scopeIndex, Wrapper[] wrappers, List<Object> scopes) throws GuardException { Object scope = oh.coerce(scopes.get(scopeIndex)); // The value may be buried by . notation if (wrappers != null) { for (Wrapper wrapper : wrappers) { scope = oh.coerce(wrapper.call(ObjectHandler.makeList(scope))); } } return scope; }
try { scope = coerce(wrapper.call(ObjectHandler.makeList(scope))); } catch (GuardException e) { throw new AssertionError(e);
try { scope = coerce(wrapper.call(ObjectHandler.makeList(coerce(scope)))); } catch (GuardException e) { throw new AssertionError(e);