Package com.github.antlrjavaparser.api.expr

Examples of com.github.antlrjavaparser.api.expr.ClassExpr


        if (value instanceof ClassAttributeValue) {
            final JavaType castValue = ((ClassAttributeValue) value).getValue();
            // This doesn't preserve type parameters
            final NameExpr nameExpr = JavaParserUtils.getNameExpr(castValue
                    .getFullyQualifiedTypeName());
            final ClassExpr convertedValue = new ClassExpr(
                    JavaParserUtils.getReferenceType(nameExpr));
            return new MemberValuePair(value.getName().getSymbolName(),
                    convertedValue);
        }
View Full Code Here


                    new JavaSymbolName(name));
            return new EnumAttributeValue(annotationName, enumDetails);
        }

        if (expression instanceof ClassExpr) {
            final ClassExpr clazz = (ClassExpr) expression;
            final Type nameToFind = clazz.getType();
            final JavaType javaType = JavaParserUtils.getJavaType(
                    compilationUnitServices, nameToFind, null);
            return new ClassAttributeValue(annotationName, javaType);
        }
View Full Code Here

                final JavaType javaType = new JavaType(
                        ((ClassOrInterfaceType) type).getName());
                final NameExpr nameToUse = importTypeIfRequired(targetType,
                        imports, javaType);
                if (!(nameToUse instanceof QualifiedNameExpr)) {
                    return new ClassExpr(new ClassOrInterfaceType(
                            javaType.getSimpleTypeName()));
                }
            }
            else if (type instanceof ReferenceType
                    && ((ReferenceType) type).getType() instanceof ClassOrInterfaceType) {
                final ClassOrInterfaceType cit = (ClassOrInterfaceType) ((ReferenceType) type)
                        .getType();
                final JavaType javaType = new JavaType(cit.getName());
                final NameExpr nameToUse = importTypeIfRequired(targetType,
                        imports, javaType);
                if (!(nameToUse instanceof QualifiedNameExpr)) {
                    return new ClassExpr(new ClassOrInterfaceType(
                            javaType.getSimpleTypeName()));
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.github.antlrjavaparser.api.expr.ClassExpr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.