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


Java FieldDeclaration.getJavadoc方法代码示例

本文整理汇总了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;
}
 
开发者ID:linzeqipku,项目名称:SnowGraph,代码行数:27,代码来源:JavaASTVisitor.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:21,代码来源:ASTFlattener.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:24,代码来源:NaiveASTFlattener.java

示例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()));
			}
		}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:ExtractClassRefactoring.java


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