本文整理汇总了Java中org.eclipse.jdt.core.dom.FieldDeclaration.getJavadoc方法的典型用法代码示例。如果您正苦于以下问题:Java FieldDeclaration.getJavadoc方法的具体用法?Java FieldDeclaration.getJavadoc怎么用?Java FieldDeclaration.getJavadoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.dom.FieldDeclaration
的用法示例。
在下文中一共展示了FieldDeclaration.getJavadoc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFieldInfos
import org.eclipse.jdt.core.dom.FieldDeclaration; //导入方法依赖的package包/类
private List<FieldInfo> createFieldInfos(FieldDeclaration node, String belongTo) {
List<FieldInfo> fieldInfos = new ArrayList<>();
Type type = node.getType();
Set<String> types = getTypes(type);
String typeString = type.toString();
String visibility = getVisibility(node);
boolean isStatic = isStatic(node);
boolean isFinal = isFinal(node);
String comment = "";
if (node.getJavadoc() != null)
comment = sourceContent.substring(node.getJavadoc().getStartPosition(), node.getJavadoc().getStartPosition() + node.getJavadoc().getLength());
List<VariableDeclarationFragment> fragments = node.fragments();
for (VariableDeclarationFragment fragment : fragments) {
FieldInfo fieldInfo = new FieldInfo();
fieldInfo.belongTo = belongTo;
fieldInfo.name = fragment.getName().getFullyQualifiedName();
fieldInfo.typeString = typeString;
fieldInfo.types = types;
fieldInfo.visibility = visibility;
fieldInfo.isFinal = isFinal;
fieldInfo.isStatic = isStatic;
fieldInfo.comment = comment;
fieldInfos.add(fieldInfo);
}
return fieldInfos;
}
示例2: visit
import org.eclipse.jdt.core.dom.FieldDeclaration; //导入方法依赖的package包/类
@Override
public boolean visit(FieldDeclaration node) {
if (node.getJavadoc() != null) {
node.getJavadoc().accept(this);
}
if (node.getAST().apiLevel() >= JLS3) {
printModifiers(node.modifiers());
}
node.getType().accept(this);
this.fBuffer.append(" ");//$NON-NLS-1$
for (Iterator<VariableDeclarationFragment> it= node.fragments().iterator(); it.hasNext();) {
VariableDeclarationFragment f= it.next();
f.accept(this);
if (it.hasNext()) {
this.fBuffer.append(", ");//$NON-NLS-1$
}
}
this.fBuffer.append(";");//$NON-NLS-1$
return false;
}
示例3: visit
import org.eclipse.jdt.core.dom.FieldDeclaration; //导入方法依赖的package包/类
public boolean visit(FieldDeclaration node) {
if (node.getJavadoc() != null) {
node.getJavadoc().accept(this);
}
printIndent();
if (node.getAST().apiLevel() == JLS2) {
printModifiers(node.getModifiers());
}
if (node.getAST().apiLevel() >= JLS3) {
printModifiers(node.modifiers());
}
node.getType().accept(this);
this.buffer.append(" ");//$NON-NLS-1$
for (Iterator it = node.fragments().iterator(); it.hasNext(); ) {
VariableDeclarationFragment f = (VariableDeclarationFragment) it.next();
f.accept(this);
if (it.hasNext()) {
this.buffer.append(", ");//$NON-NLS-1$
}
}
this.buffer.append(";\n");//$NON-NLS-1$
return false;
}
示例4: fieldCreated
import org.eclipse.jdt.core.dom.FieldDeclaration; //导入方法依赖的package包/类
@Override
public void fieldCreated(CompilationUnitRewrite cuRewrite, FieldDeclaration field, ParameterInfo pi) {
FieldInfo fieldInfo= getFieldInfo(pi.getOldName());
FieldDeclaration parent= (FieldDeclaration) fieldInfo.declaration.getParent();
List<IExtendedModifier> modifiers= parent.modifiers();
ListRewrite listRewrite= cuRewrite.getASTRewrite().getListRewrite(field, FieldDeclaration.MODIFIERS2_PROPERTY);
for (Iterator<IExtendedModifier> iterator= modifiers.iterator(); iterator.hasNext();) {
IExtendedModifier mod= iterator.next();
//Temporarily disabled until initialization of final fields is handled correctly
// if (mod.isModifier()) {
// Modifier modifier= (Modifier) mod;
// if (modifier.isFinal())
// listRewrite.insertLast(moveNode(cuRewrite, modifier), null);
// }
if (mod.isAnnotation()) {
listRewrite.insertFirst(moveNode(cuRewrite, (ASTNode) mod), null);
}
}
if (fieldInfo.initializer != null && fieldInfo.hasFieldReference()) {
List<VariableDeclarationFragment> fragments= field.fragments();
for (Iterator<VariableDeclarationFragment> iterator= fragments.iterator(); iterator.hasNext();) {
VariableDeclarationFragment vdf= iterator.next();
vdf.setInitializer((Expression) moveNode(cuRewrite, fieldInfo.initializer));
}
}
if (parent.getJavadoc() != null) {
field.setJavadoc((Javadoc) moveNode(cuRewrite, parent.getJavadoc()));
}
}