com.redhat.ceylon.compiler.java.codegen.StringLiteralAnnotationTerm 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 StringLiteralAnnotationTerm extends LiteralAnnotationTerm {
/**
* Sometimes we need an instance just for calling
* {@link #makeAtValue(ExpressionTransformer, String, JCExpression)} on.
*/
public static final LiteralAnnotationTerm FACTORY = new StringLiteralAnnotationTerm(null);
final String value;
public StringLiteralAnnotationTerm(String value) {
super();
this.value = value;
}
@Override
protected com.redhat.ceylon.langtools.tools.javac.util.List makeAtValue(ExpressionTransformer exprGen, String name, JCExpression value) {
return exprGen.makeAtStringValue(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.makeAtStringExprs(exprGen.make().NewArray(null, null, (com.redhat.ceylon.langtools.tools.javac.util.List)value));
}
@Override
public String toString() {
return "\"" + value + "\"";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy