本文整理汇总了Java中japa.parser.ast.type.VoidType类的典型用法代码示例。如果您正苦于以下问题:Java VoidType类的具体用法?Java VoidType怎么用?Java VoidType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VoidType类属于japa.parser.ast.type包,在下文中一共展示了VoidType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getRawTypeName
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
private static String getRawTypeName(Type type) {
if (type instanceof ClassOrInterfaceType) {
return getQualifiedName((ClassOrInterfaceType) type);
}
if (type instanceof ReferenceType) {
ReferenceType refType = (ReferenceType) type;
return getRawTypeName(refType.getType()) + StringUtils.multiply("[]", refType.getArrayCount());
}
if (type instanceof PrimitiveType) {
return ((PrimitiveType) type).getType().name().toLowerCase();
}
if (type instanceof VoidType) {
return "void";
}
if (type instanceof WildcardType) {
return "java.lang.Object";
}
return type.toString();
}
开发者ID:jedwards1211,项目名称:breakout,代码行数:20,代码来源:JavaParserUtils.java
示例2: isSetterMethod
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
private boolean isSetterMethod(MethodDeclaration method)
{
if ((method.getBody() != null) && (method.getBody().getStmts() != null))
{
LinkedList<String> attNames = getAttributesNames();
if (attNames.size() == 0)
return false;
List<Statement> stmts = method.getBody().getStmts();
for (Statement stmt : stmts)
for (String name : attNames)
if ((method.getModifiers() == ModifierSet.PUBLIC) && (method.getParameters() != null) && (method.getParameters().size() == 1) && (method.getType().equals(new VoidType())) && (stmt.toString().matches("(.*)"+name+"(\\s*)=(.*)"+method.getParameters().get(0).getId().getName()+"(.*);")))
return true;
}
return false;
}
开发者ID:gems-uff,项目名称:oceano,代码行数:20,代码来源:NumberOfAccessorMethods.java
示例3: addAttachSkeleton
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
private void addAttachSkeleton() {
List<Parameter> params = Collections.emptyList();
MethodDeclaration method = new MethodDeclaration(
ModifierSet.PUBLIC, new VoidType(), "attach", params);
AnnotationExpr override = new MarkerAnnotationExpr(new NameExpr("Override"));
method.setAnnotations(Collections.singletonList(override));
BlockStmt block = new BlockStmt();
Expression e = new MethodCallExpr(new SuperExpr(), "attach");
List<Statement> sts = Collections.singletonList((Statement)new ExpressionStmt(e));
block.setStmts(sts);
method.setBody(block);
if (getType().getMembers()==null) {
getType().setMembers(new LinkedList<BodyDeclaration>());
}
getType().getMembers().add(method);
}
开发者ID:ahn,项目名称:mideaas,代码行数:19,代码来源:ControllerCode.java
示例4: addOnBecomingVisibleMethod
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
@SuppressWarnings("unused")
private void addOnBecomingVisibleMethod() {
List<Parameter> params = Collections.emptyList();
MethodDeclaration method = new MethodDeclaration(
ModifierSet.PUBLIC, new VoidType(), "onBecomingVisible", params);
AnnotationExpr override = new MarkerAnnotationExpr(new NameExpr("Override"));
method.setAnnotations(Collections.singletonList(override));
BlockStmt block = new BlockStmt();
Expression e = new MethodCallExpr(new SuperExpr(), "onBecomingVisible");
List<Statement> sts = Collections.singletonList((Statement)new ExpressionStmt(e));
block.setStmts(sts);
method.setBody(block);
if (getType().getMembers()==null) {
getType().setMembers(new LinkedList<BodyDeclaration>());
}
getType().getMembers().add(method);
}
开发者ID:ahn,项目名称:mideaas,代码行数:20,代码来源:ControllerCode.java
示例5: addClaraHandler
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
private MethodDeclaration addClaraHandler(String id, String className) {
ensureImport(className);
String shortName = className.substring(className.lastIndexOf(".")+1);
String handlerName = generateHandlerNameFor(id, shortName);
Parameter p = new Parameter(new ClassOrInterfaceType(shortName), new VariableDeclaratorId("event"));
MethodDeclaration handler = new MethodDeclaration(
ModifierSet.PUBLIC, new VoidType(), handlerName, Collections.singletonList(p));
handler.setBody(new BlockStmt());
handler.setAnnotations(createClaraHandlerAnnotations(id));
addNotification(handler, shortName+" on "+id);
addMember(handler);
return handler;
}
开发者ID:ahn,项目名称:mideaas,代码行数:17,代码来源:ControllerCode.java
示例6: getType
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
/**
* Given a primitive type, computes the corresponding Java Parser type.
* <p>
* Presenting a non-primitive type to this method will throw an exception.
* If you have a non-primitive type, use
* {@link #importTypeIfRequired(JavaType, List, JavaType)} and then present
* the {@link NameExpr} it returns to
* {@link #getClassOrInterfaceType(NameExpr)}.
*
* @param javaType a primitive type (required, and must be primitive)
* @return the equivalent Java Parser {@link Type}
*/
public static Type getType(final JavaType javaType) {
Validate.notNull(javaType, "Java type required");
Validate.isTrue(javaType.isPrimitive(),
"Java type must be primitive to be presented to this method");
if (javaType.equals(JavaType.VOID_PRIMITIVE)) {
return new VoidType();
}
else if (javaType.equals(JavaType.BOOLEAN_PRIMITIVE)) {
return new PrimitiveType(Primitive.Boolean);
}
else if (javaType.equals(JavaType.BYTE_PRIMITIVE)) {
return new PrimitiveType(Primitive.Byte);
}
else if (javaType.equals(JavaType.CHAR_PRIMITIVE)) {
return new PrimitiveType(Primitive.Char);
}
else if (javaType.equals(JavaType.DOUBLE_PRIMITIVE)) {
return new PrimitiveType(Primitive.Double);
}
else if (javaType.equals(JavaType.FLOAT_PRIMITIVE)) {
return new PrimitiveType(Primitive.Float);
}
else if (javaType.equals(JavaType.INT_PRIMITIVE)) {
return new PrimitiveType(Primitive.Int);
}
else if (javaType.equals(JavaType.LONG_PRIMITIVE)) {
return new PrimitiveType(Primitive.Long);
}
else if (javaType.equals(JavaType.SHORT_PRIMITIVE)) {
return new PrimitiveType(Primitive.Short);
}
throw new IllegalStateException("Unknown primitive " + javaType);
}
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:46,代码来源:JavaParserUtils.java
示例7: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
@Override
public JType visit(VoidType type, JCodeModel codeModel) {
return codeModel.VOID;
}
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:5,代码来源:TypeToJTypeConvertingVisitor.java
示例8: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
@Override
public void visit(VoidType n, Generator arg) {
throw new TransformException("don't know how to linearize");
}
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:LinearizeTransform.java
示例9: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
@Override
public Boolean visit(VoidType n, Void arg) {
return false;
}
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:NodeAnnotator.java
示例10: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
@Override
public void visit(VoidType n, Scope arg) {
super.visit(n, arg);
n.setData(arg);
}
开发者ID:rfw,项目名称:genja,代码行数:6,代码来源:ScopeCollector.java
示例11: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
public R visit(VoidType n, A arg) {
return null;
}
开发者ID:rfw,项目名称:genja,代码行数:4,代码来源:GenericVisitorAdapter.java
示例12: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
public Boolean visit(VoidType n1, Node arg) {
return Boolean.TRUE;
}
开发者ID:rfw,项目名称:genja,代码行数:4,代码来源:EqualsVisitor.java
示例13: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
public void visit(VoidType n, Object arg) {
printer.print("void");
}
开发者ID:rfw,项目名称:genja,代码行数:4,代码来源:DumpVisitor.java
示例14: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
public void visit(VoidType n, A arg) {
}
开发者ID:rfw,项目名称:genja,代码行数:3,代码来源:VoidVisitorAdapter.java
示例15: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
public Node visit(VoidType n, A arg) {
return n;
}
开发者ID:rfw,项目名称:genja,代码行数:4,代码来源:ModifierVisitorAdapter.java
示例16: visit
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
@Override
public void visit(VoidType n, Object arg) {
doTest(source, n);
super.visit(n, arg);
}
开发者ID:rfw,项目名称:genja,代码行数:6,代码来源:TestNodePositions.java
示例17: visitPre
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
@Override
public void visitPre(VoidType n, A arg) {
}
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:VoidVisitorHelperBase.java
示例18: visitPost
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
@Override
public void visitPost(VoidType n, A arg) {
}
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:VoidVisitorHelperBase.java
示例19: visitPre
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
void visitPre(VoidType n, A arg);
开发者ID:kuali,项目名称:kc-rice,代码行数:2,代码来源:VoidVisitorHelper.java
示例20: visitPost
import japa.parser.ast.type.VoidType; //导入依赖的package包/类
void visitPost(VoidType n, A arg);
开发者ID:kuali,项目名称:kc-rice,代码行数:2,代码来源:VoidVisitorHelper.java
注:本文中的japa.parser.ast.type.VoidType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论