/** * @since 2.3.20 */ public ParseException(String description, TemplateObject tobj, Throwable cause) { this(description, tobj.getTemplate() == null ? null : tobj.getTemplate().getSourceName(), tobj.beginLine, tobj.beginColumn, tobj.endLine, tobj.endColumn, cause); }
public static int getTemplateLanguageVersionAsInt(TemplateObject to) { return getTemplateLanguageVersionAsInt(to.getTemplate()); }
/** * Returns an {@link ArithmeticEngine} even if {@code env} is {@code null}, because we are in parsing phase. */ static ArithmeticEngine getArithmeticEngine(Environment env, TemplateObject tObj) { return env != null ? env.getArithmeticEngine() : tObj.getTemplate().getParserConfiguration().getArithmeticEngine(); }
private void calculatePosition() { synchronized (lock) { if (!positionsCalculated) { // The expressions is the argument of the template element, so we prefer it as it's more specific. TemplateObject templateObject = blamedExpression != null ? (TemplateObject) blamedExpression : ( ftlInstructionStackSnapshot != null && ftlInstructionStackSnapshot.length != 0 ? ftlInstructionStackSnapshot[0] : null); // Line number blow 0 means no info, negative means position in ?eval-ed value that we won't use here. if (templateObject != null && templateObject.getBeginLine() > 0) { final Template template = templateObject.getTemplate(); templateName = template != null ? template.getName() : null; templateSourceName = template != null ? template.getSourceName() : null; lineNumber = Integer.valueOf(templateObject.getBeginLine()); columnNumber = Integer.valueOf(templateObject.getBeginColumn()); endLineNumber = Integer.valueOf(templateObject.getEndLine()); endColumnNumber = Integer.valueOf(templateObject.getEndColumn()); } positionsCalculated = true; deleteFTLInstructionStackSnapshotIfNotNeeded(); } } }
String name = callPlace != null ? callPlace.getTemplate().getName() : null; return name != null ? new SimpleScalar(name) : TemplateScalarModel.EMPTY_STRING;
/** * @since 2.3.20 */ public ParseException(String description, TemplateObject tobj, Throwable cause) { this(description, tobj.getTemplate() == null ? null : tobj.getTemplate().getSourceName(), tobj.beginLine, tobj.beginColumn, tobj.endLine, tobj.endColumn, cause); }
/** * @since 2.3.20 */ public ParseException(String description, TemplateObject tobj, Throwable cause) { this(description, tobj.getTemplate() == null ? null : tobj.getTemplate().getSourceName(), tobj.beginLine, tobj.beginColumn, tobj.endLine, tobj.endColumn, cause); }
public static int getTemplateLanguageVersionAsInt(TemplateObject to) { return getTemplateLanguageVersionAsInt(to.getTemplate()); }
public static int getTemplateLanguageVersionAsInt(TemplateObject to) { return getTemplateLanguageVersionAsInt(to.getTemplate()); }
/** * Returns an {@link ArithmeticEngine} even if {@code env} is {@code null}, because we are in parsing phase. */ static ArithmeticEngine getArithmeticEngine(Environment env, TemplateObject tObj) { return env != null ? env.getArithmeticEngine() : tObj.getTemplate().getParserConfiguration().getArithmeticEngine(); }
/** * Returns an {@link ArithmeticEngine} even if {@code env} is {@code null}, because we are in parsing phase. */ static ArithmeticEngine getArithmeticEngine(Environment env, TemplateObject tObj) { return env != null ? env.getArithmeticEngine() : tObj.getTemplate().getParserConfiguration().getArithmeticEngine(); }
private void calculatePosition() { synchronized (lock) { if (!positionsCalculated) { // The expressions is the argument of the template element, so we prefer it as it's more specific. TemplateObject templateObject = blamedExpression != null ? (TemplateObject) blamedExpression : ( ftlInstructionStackSnapshot != null && ftlInstructionStackSnapshot.length != 0 ? ftlInstructionStackSnapshot[0] : null); // Line number blow 0 means no info, negative means position in ?eval-ed value that we won't use here. if (templateObject != null && templateObject.getBeginLine() > 0) { final Template template = templateObject.getTemplate(); templateName = template != null ? template.getName() : null; templateSourceName = template != null ? template.getSourceName() : null; lineNumber = Integer.valueOf(templateObject.getBeginLine()); columnNumber = Integer.valueOf(templateObject.getBeginColumn()); endLineNumber = Integer.valueOf(templateObject.getEndLine()); endColumnNumber = Integer.valueOf(templateObject.getEndColumn()); } positionsCalculated = true; deleteFTLInstructionStackSnapshotIfNotNeeded(); } } }
private void calculatePosition() { synchronized (lock) { if (!positionsCalculated) { // The expressions is the argument of the template element, so we prefer it as it's more specific. TemplateObject templateObject = blamedExpression != null ? (TemplateObject) blamedExpression : ( ftlInstructionStackSnapshot != null && ftlInstructionStackSnapshot.length != 0 ? ftlInstructionStackSnapshot[0] : null); // Line number blow 0 means no info, negative means position in ?eval-ed value that we won't use here. if (templateObject != null && templateObject.getBeginLine() > 0) { final Template template = templateObject.getTemplate(); templateName = template != null ? template.getName() : null; templateSourceName = template != null ? template.getSourceName() : null; lineNumber = Integer.valueOf(templateObject.getBeginLine()); columnNumber = Integer.valueOf(templateObject.getBeginColumn()); endLineNumber = Integer.valueOf(templateObject.getEndLine()); endColumnNumber = Integer.valueOf(templateObject.getEndColumn()); } positionsCalculated = true; deleteFTLInstructionStackSnapshotIfNotNeeded(); } } }
String name = callPlace != null ? callPlace.getTemplate().getName() : null; return name != null ? new SimpleScalar(name) : TemplateScalarModel.EMPTY_STRING;
String name = callPlace != null ? callPlace.getTemplate().getName() : null; return name != null ? new SimpleScalar(name) : TemplateScalarModel.EMPTY_STRING;