本文整理汇总了Java中com.sun.source.doctree.AttributeTree类的典型用法代码示例。如果您正苦于以下问题:Java AttributeTree类的具体用法?Java AttributeTree怎么用?Java AttributeTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttributeTree类属于com.sun.source.doctree包,在下文中一共展示了AttributeTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visitStartElement
import com.sun.source.doctree.AttributeTree; //导入依赖的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: validateHtml4Attrs
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
private void validateHtml4Attrs(AttributeTree tree, Name name, AttrKind k) {
switch (k) {
case ALL:
case HTML4:
break;
case INVALID:
env.messages.error(HTML, tree, "dc.attr.unknown", name);
break;
case OBSOLETE:
env.messages.warning(ACCESSIBILITY, tree, "dc.attr.obsolete", name);
break;
case USE_CSS:
env.messages.warning(ACCESSIBILITY, tree, "dc.attr.obsolete.use.css", name);
break;
case HTML5:
env.messages.error(HTML, tree, "dc.attr.not.supported.html4", name);
break;
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:Checker.java
示例3: rewriteChildren
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
protected final AttributeTree rewriteChildren(AttributeTree tree) {
AttributeTree value = tree;
List<? extends DocTree> vl = translateDoc(tree.getValue());
if (vl != tree.getValue()) {
value = make.Attribute((Name) tree.getName(), tree.getValueKind(), vl);
}
return value;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ImmutableDocTreeTranslator.java
示例4: visitAttribute
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
@Override
public Void visitAttribute(AttributeTree node, Void p) {
print(node.getName());
String quote;
switch (node.getValueKind()) {
case EMPTY:
return null;
case UNQUOTED:
quote = "";
break;
case SINGLE:
quote = "'";
break;
case DOUBLE:
quote = "\"";
break;
default:
throw new AssertionError();
}
print("=");
print(quote);
for (DocTree docTree : node.getValue()) {
doAccept((DCTree)docTree);
}
print(quote);
return null;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:VeryPretty.java
示例5: getAttrValue
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
private String getAttrValue(AttributeTree tree) {
if (tree.getValue() == null)
return null;
StringWriter sw = new StringWriter();
try {
new DocPretty(sw).print(tree.getValue());
} catch (IOException e) {
// cannot happen
}
// ignore potential use of entities for now
return sw.toString();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:Checker.java
示例6: checkURI
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
private void checkURI(AttributeTree tree, String uri) {
try {
URI u = new URI(uri);
} catch (URISyntaxException e) {
env.messages.error(HTML, tree, "dc.invalid.uri", uri);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Checker.java
示例7: validateHtml5Attrs
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
private void validateHtml5Attrs(AttributeTree tree, Name name, AttrKind k) {
switch (k) {
case ALL:
case HTML5:
break;
case INVALID:
case OBSOLETE:
case USE_CSS:
case HTML4:
env.messages.error(HTML, tree, "dc.attr.not.supported.html5", name);
break;
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:Checker.java
示例8: checkURI
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
private void checkURI(AttributeTree tree, String uri) {
// allow URIs beginning with javascript:, which would otherwise be rejected by the URI API.
if (uri.startsWith("javascript:"))
return;
try {
URI u = new URI(uri);
} catch (URISyntaxException e) {
env.messages.error(HTML, tree, "dc.invalid.uri", uri);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:Checker.java
示例9: visitAttribute
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
@Override
public DocTree visitAttribute(AttributeTree tree, Object p) {
return rewriteChildren(tree);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ImmutableDocTreeTranslator.java
示例10: Attribute
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
public AttributeTree Attribute(CharSequence name, AttributeTree.ValueKind vkind, List<? extends DocTree> value) {
return docMake.at(NOPOS).newAttributeTree((Name) names.fromString(name.toString()), vkind, value);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:TreeFactory.java
示例11: visitAttribute
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
/**
* @since 1.47
*/
@Override
public DocTree visitAttribute(AttributeTree node, Element p) {
return docScanner.visitAttribute(node, p, null);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:RefactoringVisitor.java
示例12: visitAttribute
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
@Override
public Void visitAttribute(AttributeTree node, List<ErrorDescription> errors) {
return super.visitAttribute(node, errors);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:Analyzer.java
示例13: visitAttribute
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitAttribute(AttributeTree tree, Consumer<DocTreePath> f) {
String name = tree.getName().toString().toLowerCase(Locale.ENGLISH);
switch (name) {
// See https://www.w3.org/TR/html-markup/global-attributes.html#common.attrs.event-handler
case "onabort": case "onblur": case "oncanplay": case "oncanplaythrough":
case "onchange": case "onclick": case "oncontextmenu": case "ondblclick":
case "ondrag": case "ondragend": case "ondragenter": case "ondragleave":
case "ondragover": case "ondragstart": case "ondrop": case "ondurationchange":
case "onemptied": case "onended": case "onerror": case "onfocus": case "oninput":
case "oninvalid": case "onkeydown": case "onkeypress": case "onkeyup":
case "onload": case "onloadeddata": case "onloadedmetadata": case "onloadstart":
case "onmousedown": case "onmousemove": case "onmouseout": case "onmouseover":
case "onmouseup": case "onmousewheel": case "onpause": case "onplay":
case "onplaying": case "onprogress": case "onratechange": case "onreadystatechange":
case "onreset": case "onscroll": case "onseeked": case "onseeking":
case "onselect": case "onshow": case "onstalled": case "onsubmit": case "onsuspend":
case "ontimeupdate": case "onvolumechange": case "onwaiting":
// See https://www.w3.org/TR/html4/sgml/dtd.html
// Most of the attributes that take a %Script are also defined as event handlers
// in HTML 5. The one exception is onunload.
// case "onchange": case "onclick": case "ondblclick": case "onfocus":
// case "onkeydown": case "onkeypress": case "onkeyup": case "onload":
// case "onmousedown": case "onmousemove": case "onmouseout": case "onmouseover":
// case "onmouseup": case "onreset": case "onselect": case "onsubmit":
case "onunload":
f.accept(getCurrentPath());
break;
// See https://www.w3.org/TR/html4/sgml/dtd.html
// https://www.w3.org/TR/html5/
// These are all the attributes that take a %URI or a valid URL potentially surrounded
// by spaces
case "action": case "cite": case "classid": case "codebase": case "data":
case "datasrc": case "for": case "href": case "longdesc": case "profile":
case "src": case "usemap":
List<? extends DocTree> value = tree.getValue();
if (value != null && !value.isEmpty() && value.get(0).getKind() == Kind.TEXT) {
String v = value.get(0).toString().trim().toLowerCase(Locale.ENGLISH);
if (v.startsWith("javascript:")) {
f.accept(getCurrentPath());
}
}
break;
}
return super.visitAttribute(tree, f);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:49,代码来源:JavaScriptScanner.java
示例14: Attribute
import com.sun.source.doctree.AttributeTree; //导入依赖的package包/类
/**Creates the DocTree's HTML AttributeTree.
*
* @param name attribute name
* @param vkind attribute value kid
* @param value attribute value
* @return newly created AttributeTree
* @since 0.124
*/
public AttributeTree Attribute(CharSequence name, AttributeTree.ValueKind vkind, List<? extends DocTree> value) {
return delegate.Attribute(name, vkind, value);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:TreeMaker.java
示例15: newAttributeTree
import com.sun.source.doctree.AttributeTree; //导入依赖的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类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论