Package com.github.antlrjavaparser.api.expr

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


                if (converted != null) {
                    arrayElements.add(converted.getValue());
                }
            }
            return new MemberValuePair(value.getName().getSymbolName(),
                    new ArrayInitializerExpr(arrayElements));
        }

        throw new UnsupportedOperationException("Unsupported attribute value '"
                + value.getName() + "' of type '" + value.getClass().getName()
                + "'");
View Full Code Here


                    compilationUnitServices, nameToFind, null);
            return new ClassAttributeValue(annotationName, javaType);
        }

        if (expression instanceof ArrayInitializerExpr) {
            final ArrayInitializerExpr castExp = (ArrayInitializerExpr) expression;
            final List<AnnotationAttributeValue<?>> arrayElements = new ArrayList<AnnotationAttributeValue<?>>();
            for (final Expression e : castExp.getValues()) {
                arrayElements.add(convert(null, e, compilationUnitServices));
            }
            return new ArrayAttributeValue<AnnotationAttributeValue<?>>(
                    annotationName, arrayElements);
        }

        if (expression instanceof UnaryExpr) {
            final UnaryExpr castExp = (UnaryExpr) expression;
            if (castExp.getOperator() == Operator.negative) {
                String value = castExp.toString();
                value = value.toUpperCase().endsWith("L") ? value.substring(0,
                        value.length() - 1) : value;
                final long l = new Long(value);
                return new LongAttributeValue(annotationName, l);
            }
View Full Code Here

TOP

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

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.