Codota Logo
com.lyncode.jtwig.exception
Code IndexAdd Codota to your IDE (free)

How to use com.lyncode.jtwig.exception

Best Java code snippets using com.lyncode.jtwig.exception (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: com.lyncode/jtwig-core-java6

  @Override
  public JtwigResource resolve(String relativePath) throws ResourceException {
    throw new ResourceException("Cannot resolve relative resources in a String resource");
  }
}
origin: com.lyncode/jtwig-core-java6

boolean throwException(ParseException exception) throws ParseBypassException {
  throw new ParseBypassException(exception);
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

@Override
public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException {
  try {
    outputStream.write(String.valueOf(expression.calculate(context)).getBytes());
    return true;
  } catch (IOException e) {
    throw new RenderException(e);
  } catch (CalculateException e) {
    throw new RenderException(e);
  }
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

@Override
public Object calculate(JtwigContext context) throws CalculateException {
  try {
    return context.function(getName()).execute(arguments(context));
  } catch (FunctionException e) {
    throw new CalculateException(e);
  } catch (FunctionNotFoundException e) {
    throw new CalculateException(e);
  }
}
origin: com.lyncode/jtwig-core-java6

boolean assertEqual(String value1, String value2) {
  if (!value1.equals(value2))
    return throwException(new ParseException("Start statement and ending block names do not match"));
  else
    return true;
}
origin: com.lyncode/jtwig-core-java6

@Override
public Content compile(JtwigResource resource) throws CompileException {
  try {
    JtwigResource jtwigResource = resource.resolve(path);
    JtwigDocument jtwigDocument = JtwigParser.parse(jtwigResource);
    return jtwigDocument.compile(jtwigResource);
  } catch (ParseException e) {
    throw new CompileException(e);
  } catch (ResourceException e) {
    throw new CompileException(e);
  }
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

  @Override
  public JtwigResource resolve(String relativePath) throws ResourceException {
    throw new ResourceException("Cannot resolve relative resources in a String resource");
  }
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

boolean throwException(ParseException exception) throws ParseBypassException {
  throw new ParseBypassException(exception);
}
origin: com.lyncode/jtwig-core-java6

@Override
public Object calculate(JtwigContext context) throws CalculateException {
  try {
    return context.function(getName()).execute(arguments(context));
  } catch (FunctionException e) {
    throw new CalculateException(e);
  } catch (FunctionNotFoundException e) {
    throw new CalculateException(e);
  }
}
origin: com.lyncode/jtwig-core-java6

@Override
public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException {
  try {
    context.set(name.getIdentifier(), assignment.calculate(context));
    return true;
  } catch (CalculateException e) {
    throw new RenderException(e);
  }
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

boolean assertEqual(String value1, String value2) {
  if (!value1.equals(value2))
    return throwException(new ParseException("Start statement and ending block names do not match"));
  else
    return true;
}
origin: com.lyncode/jtwig-core-java6

@Override
public InputStream retrieve() throws ResourceException {
  try {
    return new FileInputStream(file);
  } catch (FileNotFoundException e) {
    throw new ResourceException(e);
  }
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

boolean throwException(ParseException exception) throws ParseBypassException {
  throw new ParseBypassException(exception);
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

  @Override
  public Object calculate(JtwigContext context) throws CalculateException {
    switch (operator) {
      case NOT:
        return BooleanOperations.not(operand.calculate(context));
      case SUB:
        return MathOperations.mul(-1, operand.calculate(context));
    }
    throw new CalculateException("Unknown operator "+operator);
  }
}
origin: com.lyncode/jtwig-core-java6

@Override
public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException {
  try {
    if (isTrue(condition.calculate(context))) {
      return content.render(outputStream, context);
    }
    return false;
  } catch (CalculateException e) {
    throw new RenderException(e);
  }
}
origin: com.lyncode/jtwig-spring

@Override
public InputStream retrieve() throws ResourceException {
  InputStream resourceAsStream = servletContext.getResourceAsStream(url);
  if (resourceAsStream == null) throw new ResourceException("Resource "+url+" not found");
  return resourceAsStream;
}
origin: com.lyncode/jtwig-core-java6

boolean throwException(ParseException exception) throws ParseBypassException {
  throw new ParseBypassException(exception);
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

@Override
public InputStream retrieve() throws ResourceException {
  try {
    return new FileInputStream(file);
  } catch (FileNotFoundException e) {
    throw new ResourceException(e);
  }
}
origin: jvelo/mayocat-shop

@Override
public InputStream retrieve() throws ResourceException
{
  try {
    return new FileInputStream(resourcePath.toFile());
  } catch (FileNotFoundException e) {
    throw new ResourceException(e);
  }
}
origin: com.lyncode/jtwig-core-java6

@Override
public InputStream retrieve() throws ResourceException {
  InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(this.resource);
  if (resourceAsStream == null)
    throw new ResourceException("Resource '"+ this.resource +"' not found");
  return resourceAsStream;
}
com.lyncode.jtwig.exception

Most used classes

  • ResourceException
  • CalculateException
  • CompileException
  • ParseBypassException
  • ParseException
  • AssetResolveException
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now