本文整理了Java中org.eclipse.jdt.core.dom.CompilationUnit.setModule()
方法的一些代码示例,展示了CompilationUnit.setModule()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CompilationUnit.setModule()
方法的具体详情如下:
包路径:org.eclipse.jdt.core.dom.CompilationUnit
类名称:CompilationUnit
方法名:setModule
[英]Sets or clears the module declaration of this compilation unit node to the given module declaration node.
[中]将此编译单元节点的模块声明设置或清除为给定的模块声明节点。
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
if (property == MODULE_PROPERTY) {
if (get) {
return getModule();
} else {
setModule((ModuleDeclaration) child);
return null;
}
}
if (property == PACKAGE_PROPERTY) {
if (get) {
return getPackage();
} else {
setPackage((PackageDeclaration) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
@Override
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
if (property == MODULE_PROPERTY) {
if (get) {
return getModule();
} else {
setModule((ModuleDeclaration) child);
return null;
}
}
if (property == PACKAGE_PROPERTY) {
if (get) {
return getPackage();
} else {
setPackage((PackageDeclaration) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
compilationUnit.setFlags(compilationUnit.getFlags() | ASTNode.MALFORMED);
} else {
compilationUnit.setModule((ModuleDeclaration) declaration);
} else {
if (type instanceof ModuleDeclaration)
compilationUnit.setModule((ModuleDeclaration) type);
else
compilationUnit.types().add(type);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
compilationUnit.setFlags(compilationUnit.getFlags() | ASTNode.MALFORMED);
} else {
compilationUnit.setModule((ModuleDeclaration) declaration);
} else {
if (type instanceof ModuleDeclaration)
compilationUnit.setModule((ModuleDeclaration) type);
else
compilationUnit.types().add(type);
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
ASTNode clone0(AST target) {
CompilationUnit result = new CompilationUnit(target);
// n.b do not copy line number table or messages
result.setSourceRange(getStartPosition(), getLength());
if (this.ast.apiLevel >= AST.JLS9_INTERNAL) {
result.setModule((ModuleDeclaration) ASTNode.copySubtree(target, getModule()));
}
result.setPackage(
(PackageDeclaration) ASTNode.copySubtree(target, getPackage()));
result.imports().addAll(ASTNode.copySubtrees(target, imports()));
result.types().addAll(ASTNode.copySubtrees(target, types()));
return result;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
@Override
ASTNode clone0(AST target) {
CompilationUnit result = new CompilationUnit(target);
// n.b do not copy line number table or messages
result.setSourceRange(getStartPosition(), getLength());
if (this.ast.apiLevel >= AST.JLS9_INTERNAL) {
result.setModule((ModuleDeclaration) ASTNode.copySubtree(target, getModule()));
}
result.setPackage(
(PackageDeclaration) ASTNode.copySubtree(target, getPackage()));
result.imports().addAll(ASTNode.copySubtrees(target, imports()));
result.types().addAll(ASTNode.copySubtrees(target, types()));
return result;
}
内容来源于网络,如有侵权,请联系作者删除!