com.redhat.ceylon.compiler.java.codegen.IntegerLiteralAnnotationTerm Maven / Gradle / Ivy
package com.redhat.ceylon.compiler.java.codegen;
import com.redhat.ceylon.langtools.tools.javac.tree.JCTree.JCAnnotation;
import com.redhat.ceylon.langtools.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.redhat.ceylon.langtools.tools.javac.util.List 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.redhat.ceylon.langtools.tools.javac.util.List makeExprs(ExpressionTransformer exprGen, com.redhat.ceylon.langtools.tools.javac.util.List value) {
return exprGen.makeAtIntegerExprs(exprGen.make().NewArray(null, null, (com.redhat.ceylon.langtools.tools.javac.util.List)value));
}
@Override
public String toString() {
return Long.toString(value);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy