本文整理汇总了Java中com.intellij.lang.java.lexer.JavaDocLexer类的典型用法代码示例。如果您正苦于以下问题:Java JavaDocLexer类的具体用法?Java JavaDocLexer怎么用?Java JavaDocLexer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JavaDocLexer类属于com.intellij.lang.java.lexer包,在下文中一共展示了JavaDocLexer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isDeprecatedByDocComment
import com.intellij.lang.java.lexer.JavaDocLexer; //导入依赖的package包/类
public static boolean isDeprecatedByDocComment(@NotNull LighterAST tree, @NotNull LighterASTNode comment)
{
String text = LightTreeUtil.toFilteredString(tree, comment, null);
if(text.contains(DEPRECATED_TAG))
{
JavaDocLexer lexer = new JavaDocLexer(LanguageLevel.HIGHEST);
lexer.start(text);
IElementType token;
while((token = lexer.getTokenType()) != null)
{
if(token == JavaDocTokenType.DOC_TAG_NAME && DEPRECATED_TAG.equals(lexer.getTokenText()))
{
return true;
}
lexer.advance();
}
}
return false;
}
示例2: JavaHighlightingLexer
import com.intellij.lang.java.lexer.JavaDocLexer; //导入依赖的package包/类
public JavaHighlightingLexer(LanguageLevel languageLevel) {
super(new JavaLexer(languageLevel));
registerSelfStoppingLayer(new StringLiteralLexer('\"', JavaTokenType.STRING_LITERAL),
new IElementType[]{JavaTokenType.STRING_LITERAL}, IElementType.EMPTY_ARRAY);
registerSelfStoppingLayer(new StringLiteralLexer('\'', JavaTokenType.STRING_LITERAL),
new IElementType[]{JavaTokenType.CHARACTER_LITERAL}, IElementType.EMPTY_ARRAY);
LayeredLexer docLexer = new LayeredLexer(new JavaDocLexer(languageLevel));
HtmlHighlightingLexer lexer = new HtmlHighlightingLexer();
lexer.setHasNoEmbeddments(true);
docLexer.registerLayer(lexer, JavaDocTokenType.DOC_COMMENT_DATA);
registerSelfStoppingLayer(docLexer, new IElementType[]{JavaDocElementType.DOC_COMMENT}, IElementType.EMPTY_ARRAY);
}
示例3: createDocLexer
import com.intellij.lang.java.lexer.JavaDocLexer; //导入依赖的package包/类
@NotNull
public static Lexer createDocLexer(@NotNull LanguageLevel level) {
return new JavaDocLexer(level);
}