本文整理汇总了Java中com.sun.source.doctree.SerialFieldTree类的典型用法代码示例。如果您正苦于以下问题:Java SerialFieldTree类的具体用法?Java SerialFieldTree怎么用?Java SerialFieldTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SerialFieldTree类属于com.sun.source.doctree包,在下文中一共展示了SerialFieldTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rewriteChildren
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
protected final SerialFieldTree rewriteChildren(SerialFieldTree tree) {
SerialFieldTree value = tree;
IdentifierTree name = (IdentifierTree) translate(tree.getName());
List<? extends DocTree> description = translateDoc(tree.getDescription());
ReferenceTree ref = (ReferenceTree) translate(tree.getType());
if (ref != tree.getType() || name != tree.getName() || description != tree.getDescription()) {
value = make.SerialField(name, ref, description);
}
return value;
}
示例2: visitSerialField
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override
public Void visitSerialField(SerialFieldTree node, Void p) {
printTagName(node);
print(" ");
print((DCTree)node.getName());
print(" ");
print((DCTree)node.getType());
if (!node.getDescription().isEmpty()) {
print(" ");
for (DocTree docTree : node.getDescription()) {
doAccept((DCTree)docTree);
}
}
return null;
}
示例3: visitSerialField
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override
public Void visitSerialField(SerialFieldTree node, List<ErrorDescription> errors) {
boolean oldInheritDoc = foundInheritDoc;
super.visitSerialField(node, errors);
foundInheritDoc = oldInheritDoc;
return null;
}
示例4: getName
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
public IdentifierTree getName(DocTree dtree) {
switch (dtree.getKind()) {
case PARAM:
return ((ParamTree)dtree).getName();
case SERIAL_FIELD:
return ((SerialFieldTree)dtree).getName();
default:
return null;
}
}
示例5: getType
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
public ReferenceTree getType(DocTree dtree) {
if (dtree.getKind() == SERIAL_FIELD) {
return ((SerialFieldTree)dtree).getType();
} else {
return null;
}
}
示例6: makeSerialFieldTreeComparator
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**
* Returns a Comparator for SerialFieldTree.
* @return a Comparator
*/
public Comparator<SerialFieldTree> makeSerialFieldTreeComparator() {
if (serialFieldTreeComparator == null) {
serialFieldTreeComparator = (SerialFieldTree o1, SerialFieldTree o2) -> {
String s1 = o1.getName().toString();
String s2 = o2.getName().toString();
return s1.compareTo(s2);
};
}
return serialFieldTreeComparator;
}
示例7: makeSerialFieldTreeComparator
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**
* Returns a Comparator for SerialFieldTree.
* @return a Comparator
*/
public Comparator<SerialFieldTree> makeSerialFieldTreeComparator() {
return (SerialFieldTree o1, SerialFieldTree o2) -> {
String s1 = o1.getName().toString();
String s2 = o2.getName().toString();
return s1.compareTo(s2);
};
}
示例8: visitSerialField
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override
public DocTree visitSerialField(SerialFieldTree tree, Object p) {
return rewriteChildren(tree);
}
示例9: SerialField
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
public SerialFieldTree SerialField(com.sun.source.doctree.IdentifierTree name, ReferenceTree type, List<? extends DocTree> description) {
return docMake.at(NOPOS).newSerialFieldTree(name, type, description);
}
示例10: visitSerialField
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**
* @since 1.47
*/
@Override
public DocTree visitSerialField(SerialFieldTree node, Element p) {
return docScanner.visitSerialField(node, p, null);
}
示例11: visitSerialField
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
warnIfEmpty(tree, tree.getDescription());
return super.visitSerialField(tree, ignore);
}
示例12: visitSerialField
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitSerialField(SerialFieldTree tree, Void ignore) {
warnIfEmpty(tree, tree.getDescription());
return super.visitSerialField(tree, ignore);
}
示例13: buildSerialFieldTagsInfo
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**
* Build the serial field tags information.
*
* @param serializableFieldsTree content tree to which the documentation will be added
*/
protected void buildSerialFieldTagsInfo(Content serializableFieldsTree) {
if (configuration.nocomment) {
return;
}
VariableElement field = (VariableElement)currentMember;
// Process Serializable Fields specified as array of
// ObjectStreamFields. Print a member for each serialField tag.
// (There should be one serialField tag per ObjectStreamField
// element.)
SortedSet<SerialFieldTree> tags = new TreeSet<>(utils.makeSerialFieldTreeComparator());
// sort the elements
for (DocTree dt : utils.getSerialFieldTrees(field)) {
SerialFieldTree st = (SerialFieldTree) dt;
tags.add(st);
}
CommentHelper ch = utils.getCommentHelper(field);
for (SerialFieldTree tag : tags) {
if (tag.getName() == null || tag.getType() == null) // ignore malformed @serialField tags
continue;
Content fieldsContentTree = fieldWriter.getFieldsContentHeader(tag.equals(tags.last()));
TypeElement te = ch.getReferencedClass(configuration, tag);
String fieldType = ch.getReferencedMemberName(tag);
if (te != null && utils.isPrimitive(te.asType())) {
fieldType = utils.getTypeName(te.asType(), false);
te = null;
}
String refSignature = ch.getReferencedSignature(tag);
// TODO: Print the signature directly, if it is an array, the
// current DocTree APIs makes it very hard to distinguish
// an as these are returned back as "Array" a DeclaredType.
if (refSignature.endsWith("[]")) {
te = null;
fieldType = refSignature;
}
fieldWriter.addMemberHeader(te, fieldType, "",
tag.getName().getName().toString(), fieldsContentTree);
fieldWriter.addMemberDescription(field, tag, fieldsContentTree);
serializableFieldsTree.addContent(fieldsContentTree);
}
}
示例14: buildSerialFieldTagsInfo
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**
* Build the serial field tags information.
*
* @param serializableFieldsTree content tree to which the documentation will be added
*/
public void buildSerialFieldTagsInfo(Content serializableFieldsTree) {
if(configuration.nocomment){
return;
}
VariableElement field = (VariableElement)currentMember;
// Process Serializable Fields specified as array of
// ObjectStreamFields. Print a member for each serialField tag.
// (There should be one serialField tag per ObjectStreamField
// element.)
SortedSet<SerialFieldTree> tags = new TreeSet<>(utils.makeSerialFieldTreeComparator());
// sort the elements
for (DocTree dt : utils.getSerialFieldTrees(field)) {
SerialFieldTree st = (SerialFieldTree) dt;
tags.add(st);
}
CommentHelper ch = utils.getCommentHelper(field);
for (SerialFieldTree tag : tags) {
if (tag.getName() == null || tag.getType() == null) // ignore malformed @serialField tags
continue;
Content fieldsContentTree = fieldWriter.getFieldsContentHeader(tag.equals(tags.last()));
TypeElement te = ch.getReferencedClass(configuration, tag);
String fieldType = ch.getReferencedMemberName(tag);
if (te != null && utils.isPrimitive(te.asType())) {
fieldType = utils.getTypeName(te.asType(), false);
te = null;
}
String refSignature = ch.getReferencedSignature(tag);
// TODO: Print the signature directly, if it is an array, the
// current DocTree APIs makes it very hard to distinguish
// an as these are returned back as "Array" a DeclaredType.
if (refSignature.endsWith("[]")) {
te = null;
fieldType = refSignature;
}
fieldWriter.addMemberHeader(te, fieldType, "",
tag.getName().getName().toString(), fieldsContentTree);
fieldWriter.addMemberDescription(field, tag, fieldsContentTree);
serializableFieldsTree.addContent(fieldsContentTree);
}
}
示例15: SerialField
import com.sun.source.doctree.SerialFieldTree; //导入依赖的package包/类
/**Creates the DocTree's SerialFieldTree.
*
* @param name the name of the field
* @param type the type of the field
* @param description the description of the field
* @return newly created SerialFieldTree
* @since 0.124
*/
public SerialFieldTree SerialField(com.sun.source.doctree.IdentifierTree name, ReferenceTree type, List<? extends DocTree> description) {
return delegate.SerialField(name, type, description);
}