package com.redhat.ceylon.compiler.java.codegen; import com.sun.tools.javac.tree.JCTree.JCAnnotation; import com.sun.tools.javac.tree.JCTree.JCExpression; public class IntegerLiteralAnnotationTerm extends LiteralAnnotationTerm { /** * Sometimes we need an instance just for calling * {@link #makeAtValue(ExpressionTransformer, String, JCExpression)} on. */ public static final LiteralAnnotationTerm FACTORY = new IntegerLiteralAnnotationTerm(0); final long value; public IntegerLiteralAnnotationTerm(long value) { super(); this.value = value; } @Override public com.sun.tools.javac.util.List<JCAnnotation> makeAtValue( ExpressionTransformer exprGen, String name, JCExpression value) { return exprGen.makeAtIntegerValue(name, value); } @Override public JCExpression makeLiteral(ExpressionTransformer exprGen) { return exprGen.make().Literal(value); } @Override public com.sun.tools.javac.util.List<JCAnnotation> makeExprs(ExpressionTransformer exprGen, com.sun.tools.javac.util.List<JCAnnotation> value) { return exprGen.makeAtIntegerExprs(exprGen.make().NewArray(null, null, (com.sun.tools.javac.util.List)value)); } @Override public String toString() { return Long.toString(value); } }