/** * * @param type * @return <code>true</code> if the tag can have a helper associated, * <code>false</code> otherwise */ public static boolean supportsHelpers(MustacheTagType type) { return VARIABLE.equals(type) || UNESCAPE_VARIABLE.equals(type) || SECTION.equals(type) || INVERTED_SECTION.equals(type); }
public static boolean contentMustBeNonWhitespaceCharacterSequence( MustacheTagType type) { return VARIABLE.equals(type) || UNESCAPE_VARIABLE.equals(type) || SECTION.equals(type) || INVERTED_SECTION.equals(type) || SECTION_END.equals(type) || PARTIAL.equals(type) || EXTEND.equals(type) || EXTEND_SECTION.equals(type) || NESTED_TEMPLATE.equals(type); }
public static SegmentType fromTag(MustacheTagType tagType) { Checker.checkArgumentNotNull(tagType); for (SegmentType type : values()) { if(tagType.equals(type.getTagType())) { return type; } } if(MustacheTagType.UNESCAPE_VARIABLE.equals(tagType)) { return VALUE; } throw new IllegalStateException("Unsupported tag type"); }
private boolean isValid(MustacheTagInfo info, Set<String> validNames) { if (!info.getType().equals(MustacheTagType.SECTION)) { return false; } for (String name : validNames) { if (info.getText().startsWith(name)) { return true; } } return false; }
private boolean isValid(MustacheTagInfo info, Set<String> validNames) { if (!info.getType().equals(MustacheTagType.SECTION)) { return false; } for (String name : validNames) { if (info.getText().startsWith(name)) { return true; } } return false; }
/** * * @param options * @return <code>true</code> if the underlying tag represents a section, * <code>false</code> otherwise */ public static boolean isSection(Options options) { return options.getTagInfo().getType().equals(MustacheTagType.SECTION); }
/** * * @param options * @return <code>true</code> if the underlying tag represents a variable * which shouldn't be escaped, <code>false</code> otherwise */ public static boolean isUnescapeVariable(Options options) { return options.getTagInfo().getType() .equals(MustacheTagType.UNESCAPE_VARIABLE); }
ValueSegmentBase(ParsedTag tag, int line, int index, boolean skipValueEscaping) { super(SegmentType.VALUE, tag.getContent(), line, index); unescape = skipValueEscaping || tag.getType().equals(MustacheTagType.UNESCAPE_VARIABLE); }
/** * * @param options * @return <code>true</code> if the underlying tag represents a variable, * <code>false</code> otherwise */ public static boolean isVariable(Options options) { return options.getTagInfo().getType().equals(MustacheTagType.VARIABLE) || isUnescapeVariable(options); }