io.vertx.codetrans.expression.ExpressionModel Maven / Gradle / Ivy
package io.vertx.codetrans.expression;
import io.vertx.codegen.type.TypeInfo;
import io.vertx.codetrans.CodeBuilder;
import io.vertx.codetrans.CodeModel;
import io.vertx.codetrans.MethodSignature;
import io.vertx.codetrans.TypeArg;
import javax.lang.model.element.TypeElement;
import java.util.List;
/**
* @author Julien Viet
*/
public class ExpressionModel extends CodeModel {
protected final CodeBuilder builder;
public ExpressionModel(CodeBuilder builder) {
this.builder = builder;
}
public ExpressionModel as(TypeInfo type) {
switch (type.getKind()) {
case API:
return builder.api(this);
case JSON_OBJECT:
return new JsonObjectModel(builder, this);
case JSON_ARRAY:
return new JsonArrayModel(builder, this);
case DATA_OBJECT:
return new DataObjectModel(builder, this);
case MAP:
return new MapModel(builder, this);
case LIST:
return new ListModel(builder, this);
default:
return this;
}
}
public ExpressionModel toDataObjectValue() {
return this;
}
boolean isStringDecl() {
return false;
}
void collectParts(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy