本文整理汇总了Java中com.sun.mirror.type.VoidType类的典型用法代码示例。如果您正苦于以下问题:Java VoidType类的具体用法?Java VoidType怎么用?Java VoidType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VoidType类属于com.sun.mirror.type包,在下文中一共展示了VoidType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visitMethodDeclaration
import com.sun.mirror.type.VoidType; //导入依赖的package包/类
@Override
public void visitMethodDeclaration(MethodDeclaration methodDeclaration) {
ERROR_PREFIX = methodDeclaration.getSimpleName() + ERROR_PREFIX_STATIC;
// return type must be void
if (!(methodDeclaration.getReturnType() instanceof VoidType))
reportError(methodDeclaration,
"the method shouldn't have any return value, but instead returns " +
methodDeclaration.getReturnType().toString());
// method must not have arguments
if (!methodDeclaration.getParameters().isEmpty())
reportError(methodDeclaration, "the method accepts parameters");
}
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:17,代码来源:OnDepartureVisitorAPT.java
示例2: visitMethodDeclaration
import com.sun.mirror.type.VoidType; //导入依赖的package包/类
@Override
public void visitMethodDeclaration(MethodDeclaration methodDeclaration) {
boolean correctSignature = false;
Collection<ParameterDeclaration> methodParams = methodDeclaration.getParameters();
// return type must be void
if (methodDeclaration.getReturnType() instanceof VoidType && methodParams.size() == 2) {
Iterator<ParameterDeclaration> it = methodParams.iterator();
ParameterDeclaration param = it.next();
ParameterDeclaration param2 = it.next();
if (param.getType().toString().equals(Node.class.getName()) &&
param2.getType().toString().equals(String.class.getName())) {
correctSignature = true;
}
}
if (!correctSignature) {
reportError(methodDeclaration,
ErrorMessages.INCORRECT_METHOD_SIGNATURE_FOR_NODE_ATTACHEMENT_CALLBACK);
}
}
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:22,代码来源:NodeAttachmentCallbackVisitorAPT.java
示例3: visitMethodDeclaration
import com.sun.mirror.type.VoidType; //导入依赖的package包/类
@Override
public void visitMethodDeclaration(MethodDeclaration methodDeclaration) {
boolean correctSignature = false;
Collection<ParameterDeclaration> methodParams = methodDeclaration.getParameters();
// return type must be void
if (methodDeclaration.getReturnType() instanceof VoidType && methodParams.size() == 1) {
Iterator<ParameterDeclaration> it = methodParams.iterator();
ParameterDeclaration param = it.next();
if (param.getType().toString().equals(String.class.getName())) {
correctSignature = true;
}
}
if (!correctSignature) {
reportError(methodDeclaration, ErrorMessages.INCORRECT_METHOD_SIGNATURE_FOR_ISREADY_CALLBACK);
}
}
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:20,代码来源:VirtualNodeIsReadyCallbackVisitorAPT.java
示例4: onVoidType
import com.sun.mirror.type.VoidType; //导入依赖的package包/类
protected TypeMirror onVoidType(VoidType type, TypeDeclaration param) {
return type;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:4,代码来源:APTNavigator.java
示例5: onVoidType
import com.sun.mirror.type.VoidType; //导入依赖的package包/类
protected abstract T onVoidType(VoidType type, P param);
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:2,代码来源:APTTypeVisitor.java
注:本文中的com.sun.mirror.type.VoidType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论