Java 类com.intellij.lang.java.lexer.JavaDocLexer 实例源码

项目:consulo-java    文件:RecordUtil.java   
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;
}
项目:consulo-java    文件:JavaHighlightingLexer.java   
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);
}
项目:intellij-ce-playground    文件:JavaParserDefinition.java   
@NotNull
public static Lexer createDocLexer(@NotNull LanguageLevel level) {
  return new JavaDocLexer(level);
}
项目:tools-idea    文件:JavaParserDefinition.java   
@NotNull
public static Lexer createDocLexer(@NotNull LanguageLevel level) {
  return new JavaDocLexer(level);
}