io.javapoetext.expr.StringJExpr Maven / Gradle / Ivy
package io.javapoetext.expr;
import io.javapoetext.CodeEmitter;
/**
* 字符串表达式
*/
public class StringJExpr extends BaseJavaExpr {
private String text;
public StringJExpr(String text) {
this.text = text;
}
@Override
public void emit(CodeEmitter emitter) {
emitter.emit('"').emit(text.replace("\\\"", "\"").replace("\"", "\\\"").replaceAll("\n", "\\\\n")).emit('"');
}
@Override
public void emitImport(CodeEmitter emitter) {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy