private ThreadInterruptionCheck(TemplateElement te) throws ParseException { setLocation(te.getTemplate(), te.beginColumn, te.beginLine, te.beginColumn, te.beginLine); }
/** * Returns the {@link Template} that we are "lexically" inside at the moment. This template will change when * entering an {@code #include} or calling a macro or function in another template, or returning to yet another * template with {@code #nested}. When you are calling a directive that's implemented in Java or a Java method * from a template, the current template will be the last current template, not {@code null}. This method never * returns {@code null}. * * @see #getMainTemplate() * @see #getCurrentNamespace() * * @since 2.3.23 */ @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "False alarm") public Template getCurrentTemplate() { int ln = instructionStackSize; return ln == 0 ? getMainTemplate() : instructionStack[ln - 1].getTemplate(); }
static void appendInstructionStackItem(TemplateElement stackEl, StringBuilder sb) { sb.append(_MessageUtil.shorten(stackEl.getDescription(), 40)); sb.append(" ["); Macro enclosingMacro = getEnclosingMacro(stackEl); if (enclosingMacro != null) { sb.append(_MessageUtil.formatLocationForEvaluationError( enclosingMacro, stackEl.beginLine, stackEl.beginColumn)); } else { sb.append(_MessageUtil.formatLocationForEvaluationError( stackEl.getTemplate(), stackEl.beginLine, stackEl.beginColumn)); } sb.append("]"); }
/** * Used for some backward compatibility hacks. */ MixedContent asMixedContent() { MixedContent mixedContent = new MixedContent(); if (count != 0) { TemplateElement first = buffer[0]; mixedContent.setChildren(this); mixedContent.setLocation(first.getTemplate(), first, getLast()); } return mixedContent; }
/** * Used for some backward compatibility hacks. */ TemplateElement asSingleElement() { if (count == 0) { return new TextBlock(CollectionUtils.EMPTY_CHAR_ARRAY, false); } else { TemplateElement first = buffer[0]; if (count == 1) { return first; } else { MixedContent mixedContent = new MixedContent(); mixedContent.setChildren(this); mixedContent.setLocation(first.getTemplate(), first, getLast()); return mixedContent; } } }
private ThreadInterruptionCheck(TemplateElement te) throws ParseException { setLocation(te.getTemplate(), te.beginColumn, te.beginLine, te.beginColumn, te.beginLine); }
private ThreadInterruptionCheck(TemplateElement te) throws ParseException { setLocation(te.getTemplate(), te.beginColumn, te.beginLine, te.beginColumn, te.beginLine); }
/** * Returns the {@link Template} that we are "lexically" inside at the moment. This template will change when * entering an {@code #include} or calling a macro or function in another template, or returning to yet another * template with {@code #nested}. When you are calling a directive that's implemented in Java or a Java method * from a template, the current template will be the last current template, not {@code null}. This method never * returns {@code null}. * * @see #getMainTemplate() * @see #getCurrentNamespace() * * @since 2.3.23 */ @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "False alarm") public Template getCurrentTemplate() { int ln = instructionStackSize; return ln == 0 ? getMainTemplate() : instructionStack[ln - 1].getTemplate(); }
/** * Returns the {@link Template} that we are "lexically" inside at the moment. This template will change when * entering an {@code #include} or calling a macro or function in another template, or returning to yet another * template with {@code #nested}. When you are calling a directive that's implemented in Java or a Java method * from a template, the current template will be the last current template, not {@code null}. This method never * returns {@code null}. * * @see #getMainTemplate() * @see #getCurrentNamespace() * * @since 2.3.23 */ @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "False alarm") public Template getCurrentTemplate() { int ln = instructionStackSize; return ln == 0 ? getMainTemplate() : instructionStack[ln - 1].getTemplate(); }
static void appendInstructionStackItem(TemplateElement stackEl, StringBuilder sb) { sb.append(_MessageUtil.shorten(stackEl.getDescription(), 40)); sb.append(" ["); Macro enclosingMacro = getEnclosingMacro(stackEl); if (enclosingMacro != null) { sb.append(_MessageUtil.formatLocationForEvaluationError( enclosingMacro, stackEl.beginLine, stackEl.beginColumn)); } else { sb.append(_MessageUtil.formatLocationForEvaluationError( stackEl.getTemplate(), stackEl.beginLine, stackEl.beginColumn)); } sb.append("]"); }
static void appendInstructionStackItem(TemplateElement stackEl, StringBuilder sb) { sb.append(_MessageUtil.shorten(stackEl.getDescription(), 40)); sb.append(" ["); Macro enclosingMacro = getEnclosingMacro(stackEl); if (enclosingMacro != null) { sb.append(_MessageUtil.formatLocationForEvaluationError( enclosingMacro, stackEl.beginLine, stackEl.beginColumn)); } else { sb.append(_MessageUtil.formatLocationForEvaluationError( stackEl.getTemplate(), stackEl.beginLine, stackEl.beginColumn)); } sb.append("]"); }
/** * Used for some backward compatibility hacks. */ MixedContent asMixedContent() { MixedContent mixedContent = new MixedContent(); if (count != 0) { TemplateElement first = buffer[0]; mixedContent.setChildren(this); mixedContent.setLocation(first.getTemplate(), first, getLast()); } return mixedContent; }
/** * Used for some backward compatibility hacks. */ MixedContent asMixedContent() { MixedContent mixedContent = new MixedContent(); if (count != 0) { TemplateElement first = buffer[0]; mixedContent.setChildren(this); mixedContent.setLocation(first.getTemplate(), first, getLast()); } return mixedContent; }
/** * Used for some backward compatibility hacks. */ TemplateElement asSingleElement() { if (count == 0) { return new TextBlock(CollectionUtils.EMPTY_CHAR_ARRAY, false); } else { TemplateElement first = buffer[0]; if (count == 1) { return first; } else { MixedContent mixedContent = new MixedContent(); mixedContent.setChildren(this); mixedContent.setLocation(first.getTemplate(), first, getLast()); return mixedContent; } } }
/** * Used for some backward compatibility hacks. */ TemplateElement asSingleElement() { if (count == 0) { return new TextBlock(CollectionUtils.EMPTY_CHAR_ARRAY, false); } else { TemplateElement first = buffer[0]; if (count == 1) { return first; } else { MixedContent mixedContent = new MixedContent(); mixedContent.setChildren(this); mixedContent.setLocation(first.getTemplate(), first, getLast()); return mixedContent; } } }