com.github.mustachejava.reflect.MissingWrapper Java Examples

The following examples show how to use com.github.mustachejava.reflect.MissingWrapper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TemplateUtils.java    From dcos-commons with Apache License 2.0 5 votes vote down vote up
@Override
protected synchronized Wrapper getWrapper(String name, List<Object> scopes) {
  Wrapper wrapper = super.getWrapper(name, scopes);
  // This should only do anything when the template param is e.g. "{{hello}}", not "{{#hello}}hi{{/hello}}".
  // The latter case implies an expectation that the value will sometimes be unset. We can determine the
  // situation based on the code type:
  // - "{{hello}}" = ValueCode <-- check for this case
  // - "{{#hello}}{{/hello}}" = IterableCode
  // - "{{^hello}}{{/hello}}" = NotIterableCode
  // - etc... "{{>partial}}", "{{!comment}}"
  if (code instanceof ValueCode && wrapper instanceof MissingWrapper) {
    missingValues.add(new MissingValue(name, tc.line()));
  }
  return wrapper;
}
 
Example #2
Source File: StrictReflectionObjectHandler.java    From dropwizard-debpkg-maven-plugin with Apache License 2.0 4 votes vote down vote up
@Override
protected MissingWrapper createMissingWrapper(final String name, final List<Guard> guards) {
    throw new MissingParameterException(name);
}