Package com.github.mustachejava

Examples of com.github.mustachejava.MustacheException


        }
        writer.write(tc.endChars());
      }
      appendText(writer);
    } catch (IOException e) {
      throw new MustacheException(e);
    }
  }
View Full Code Here


          execute(writer, oh.stringify(object));
        }
      }
      return super.execute(writer, scopes);
    } catch (Exception e) {
      throw new MustacheException("Failed to get value for " + name, e, tc);
    }
  }
View Full Code Here

    } else {
      // Flush the current writer
      try {
        writer.flush();
      } catch (IOException e) {
        throw new MustacheException("Failed to flush writer", e);
      }
      final LatchedWriter latchedWriter = new LatchedWriter(writer);
      final Writer finalWriter = writer;
      les.execute(new Runnable() {
        @Override
View Full Code Here

    List<CompilableGuard> compilableGuards = new ArrayList<CompilableGuard>();
    for (Guard guard : guards) {
      if (guard instanceof CompilableGuard) {
        compilableGuards.add((CompilableGuard) guard);
      } else {
        throw new MustacheException("Invalid guard for compilation: " + guard);
      }
    }
    try {
      return compile("compiledguards:" + guards.size(), compilableGuards);
    } catch (Exception e) {
      throw new MustacheException("Compilation failure", e);
    }
  }
View Full Code Here

      @Override
      public void encode(String value, Writer writer) {
        try {
          writer.write(value);
        } catch (IOException e) {
          throw new MustacheException();
        }
      }
    };
    Mustache mustache = mb.compile(template + ".txt");
View Full Code Here

        }
        writer.write(tc.endChars());
      }
      appendText(writer);
    } catch (IOException e) {
      throw new MustacheException(e);
    }
  }
View Full Code Here

          return handleCallable(writer, (Callable) object, scopes);
        } else {
          execute(writer, oh.stringify(object));
        }
      } catch (Exception e) {
        throw new MustacheException("Failed to get value for " + name + " at line " + tc.file() + ":" + tc.line(), e);
      }
    }
    return super.execute(writer, scopes);
  }
View Full Code Here

    } else {
      // Flush the current writer
      try {
        writer.flush();
      } catch (IOException e) {
        throw new MustacheException("Failed to flush writer", e);
      }
      final LatchedWriter latchedWriter = new LatchedWriter(writer);
      final Writer finalWriter = writer;
      les.execute(new Runnable() {
        @Override
View Full Code Here

        return field.get(scope);
      } else {
        return method.invoke(scope, arguments);
      }
    } catch (IllegalArgumentException e) {
      throw new MustacheException("Wrong method for object: " + method + " on " + scope, e);
    } catch (InvocationTargetException e) {
      throw new MustacheException("Failed to execute method: " + method, e.getTargetException());
    } catch (IllegalAccessException e) {
      throw new MustacheException("Failed to execute method: " + method, e);
    }
  }
View Full Code Here

          seen.remove(mustache);
        }
      }
      return code;
    } catch (CloneNotSupportedException e) {
      throw new MustacheException("Clone not supported");
    }
  }
View Full Code Here

TOP

Related Classes of com.github.mustachejava.MustacheException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.