当前位置: 首页>>代码示例>>Java>>正文


Java ValueKind类代码示例

本文整理汇总了Java中com.sun.source.doctree.AttributeTree.ValueKind的典型用法代码示例。如果您正苦于以下问题:Java ValueKind类的具体用法?Java ValueKind怎么用?Java ValueKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValueKind类属于com.sun.source.doctree.AttributeTree包,在下文中一共展示了ValueKind类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitStartElement

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
@Override
public Void visitStartElement(StartElementTree node, Void p) {
    print("<");
    print(node.getName());
    java.util.List<? extends DocTree> attrs = node.getAttributes();
    if (!attrs.isEmpty()) {
        print(" ");
        for (DocTree docTree : attrs) {
            doAccept((DCTree)docTree);
        }
        DocTree last = attrs.get(attrs.size() - 1);
        if (node.isSelfClosing() && last instanceof AttributeTree
                && ((AttributeTree) last).getValueKind() == ValueKind.UNQUOTED)
            print(" ");
    }
    if (node.isSelfClosing())
        print("/");
    print(">");
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:VeryPretty.java

示例2: visitStartElement

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
public Void visitStartElement(StartElementTree node, Void p) {
    try {
        print("<");
        print(node.getName());
        List<? extends DocTree> attrs = node.getAttributes();
        if (!attrs.isEmpty()) {
            print(" ");
            print(attrs);
            DocTree last = node.getAttributes().get(attrs.size() - 1);
            if (node.isSelfClosing() && last instanceof AttributeTree
                    && ((AttributeTree) last).getValueKind() == ValueKind.UNQUOTED)
                print(" ");
        }
        if (node.isSelfClosing())
            print("/");
        print(">");
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:DocPretty.java

示例3: visitStartElement

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitStartElement(StartElementTree node, Void p) {
    try {
        print("<");
        print(node.getName());
        List<? extends DocTree> attrs = node.getAttributes();
        if (!attrs.isEmpty()) {
            print(" ");
            print(attrs);
            DocTree last = node.getAttributes().get(attrs.size() - 1);
            if (node.isSelfClosing() && last instanceof AttributeTree
                    && ((AttributeTree) last).getValueKind() == ValueKind.UNQUOTED)
                print(" ");
        }
        if (node.isSelfClosing())
            print("/");
        print(">");
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:DocPretty.java

示例4: visitStartElement

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
@DefinedBy(Api.COMPILER_TREE)
public Void visitStartElement(StartElementTree node, Void p) {
    try {
        print("<");
        print(node.getName());
        List<? extends DocTree> attrs = node.getAttributes();
        if (!attrs.isEmpty()) {
            print(" ");
            print(attrs);
            DocTree last = node.getAttributes().get(attrs.size() - 1);
            if (node.isSelfClosing() && last instanceof AttributeTree
                    && ((AttributeTree) last).getValueKind() == ValueKind.UNQUOTED)
                print(" ");
        }
        if (node.isSelfClosing())
            print("/");
        print(">");
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    return null;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:23,代码来源:DocPretty.java

示例5: htmlAttrs

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
/**
 * Read a series of HTML attributes, terminated by {@literal > }.
 * Each attribute is of the form {@literal identifier[=value] }.
 * "value" may be unquoted, single-quoted, or double-quoted.
 */
protected List<DCTree> htmlAttrs() {
    ListBuffer<DCTree> attrs = new ListBuffer<DCTree>();
    skipWhitespace();

    loop:
    while (isIdentifierStart(ch)) {
        int namePos = bp;
        Name name = readIdentifier();
        skipWhitespace();
        List<DCTree> value = null;
        ValueKind vkind = ValueKind.EMPTY;
        if (ch == '=') {
            ListBuffer<DCTree> v = new ListBuffer<DCTree>();
            nextChar();
            skipWhitespace();
            if (ch == '\'' || ch == '"') {
                vkind = (ch == '\'') ? ValueKind.SINGLE : ValueKind.DOUBLE;
                char quote = ch;
                nextChar();
                textStart = bp;
                while (bp < buflen && ch != quote) {
                    if (newline && ch == '@') {
                        attrs.add(erroneous("dc.unterminated.string", namePos));
                        // No point trying to read more.
                        // In fact, all attrs get discarded by the caller
                        // and superseded by a malformed.html node because
                        // the html tag itself is not terminated correctly.
                        break loop;
                    }
                    attrValueChar(v);
                }
                addPendingText(v, bp - 1);
                nextChar();
            } else {
                vkind = ValueKind.UNQUOTED;
                textStart = bp;
                while (bp < buflen && !isUnquotedAttrValueTerminator(ch)) {
                    attrValueChar(v);
                }
                addPendingText(v, bp - 1);
            }
            skipWhitespace();
            value = v.toList();
        }
        DCAttribute attr = m.at(namePos).Attribute(name, vkind, value);
        attrs.add(attr);
    }

    return attrs.toList();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:56,代码来源:DocCommentParser.java

示例6: Attribute

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
public DCAttribute Attribute(Name name, ValueKind vkind, List<DCTree> value) {
    DCAttribute tree = new DCAttribute(name, vkind, value);
    tree.pos = pos;
    return tree;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:DocTreeMaker.java

示例7: htmlAttrs

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
/**
 * Read a series of HTML attributes, terminated by {@literal > }.
 * Each attribute is of the form {@literal identifier[=value] }.
 * "value" may be unquoted, single-quoted, or double-quoted.
 */
protected List<DCTree> htmlAttrs() {
    ListBuffer<DCTree> attrs = new ListBuffer<>();
    skipWhitespace();

    loop:
    while (isIdentifierStart(ch)) {
        int namePos = bp;
        Name name = readAttributeName();
        skipWhitespace();
        List<DCTree> value = null;
        ValueKind vkind = ValueKind.EMPTY;
        if (ch == '=') {
            ListBuffer<DCTree> v = new ListBuffer<>();
            nextChar();
            skipWhitespace();
            if (ch == '\'' || ch == '"') {
                vkind = (ch == '\'') ? ValueKind.SINGLE : ValueKind.DOUBLE;
                char quote = ch;
                nextChar();
                textStart = bp;
                while (bp < buflen && ch != quote) {
                    if (newline && ch == '@') {
                        attrs.add(erroneous("dc.unterminated.string", namePos));
                        // No point trying to read more.
                        // In fact, all attrs get discarded by the caller
                        // and superseded by a malformed.html node because
                        // the html tag itself is not terminated correctly.
                        break loop;
                    }
                    attrValueChar(v);
                }
                addPendingText(v, bp - 1);
                nextChar();
            } else {
                vkind = ValueKind.UNQUOTED;
                textStart = bp;
                while (bp < buflen && !isUnquotedAttrValueTerminator(ch)) {
                    attrValueChar(v);
                }
                addPendingText(v, bp - 1);
            }
            skipWhitespace();
            value = v.toList();
        }
        DCAttribute attr = m.at(namePos).newAttributeTree(name, vkind, value);
        attrs.add(attr);
    }

    return attrs.toList();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:56,代码来源:DocCommentParser.java

示例8: newAttributeTree

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public DCAttribute newAttributeTree(javax.lang.model.element.Name name, ValueKind vkind, java.util.List<? extends DocTree> value) {
    DCAttribute tree = new DCAttribute(name, vkind, cast(value));
    tree.pos = pos;
    return tree;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:DocTreeMaker.java

示例9: newAttributeTree

import com.sun.source.doctree.AttributeTree.ValueKind; //导入依赖的package包/类
/**
 * Create a new {@code AttributeTree} object, to represent an HTML attribute in an HTML tag.
 * @param name  the name of the attribute
 * @param vkind the kind of attribute value
 * @param value the value, if any, of the attribute
 * @return an {@code AttributeTree} object
 */
AttributeTree newAttributeTree(Name name, ValueKind vkind, List<? extends DocTree> value);
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:DocTreeFactory.java


注:本文中的com.sun.source.doctree.AttributeTree.ValueKind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。