本文整理汇总了Java中com.github.javaparser.ast.expr.MemberValuePair.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java MemberValuePair.setValue方法的具体用法?Java MemberValuePair.setValue怎么用?Java MemberValuePair.setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.javaparser.ast.expr.MemberValuePair
的用法示例。
在下文中一共展示了MemberValuePair.setValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderManyToOneAnnotations
import com.github.javaparser.ast.expr.MemberValuePair; //导入方法依赖的package包/类
private void renderManyToOneAnnotations(MethodDeclaration getter) {
/*
* We need JoinColumn and ManyToOne
*/
NormalAnnotationExpr m2o = createOrFindAnnotation(getter, "javax.persistence.ManyToOne");
MemberValuePair fetch = findAnnotationPair(m2o, "fetch");
if(null == fetch) {
importIf("javax.persistence.FetchType");
m2o.addPair("fetch", "FetchType.LAZY");
}
MemberValuePair p = findAnnotationPair(m2o, "optional");
if(null == p) {
m2o.addPair("optional", Boolean.toString(m_column.isNullable()));
} else {
p.setValue(new BooleanLiteralExpr(m_column.isNullable()));
}
NormalAnnotationExpr na = createOrFindAnnotation(getter, "javax.persistence.JoinColumn");
p = findAnnotationPair(na, "name");
if(null == p) {
na.addPair("name", "\"" + m_column.getName() + "\"");
} else {
p.setValue(new StringLiteralExpr(m_column.getName()));
}
}
示例2: setPair
import com.github.javaparser.ast.expr.MemberValuePair; //导入方法依赖的package包/类
private void setPair(NormalAnnotationExpr ca, String name, String value, boolean quoted) {
MemberValuePair p = findAnnotationPair(ca, name);
if(null == p) {
ca.addPair(name, quoted ? "\"" + value + "\"" : value);
} else {
p.setValue(quoted ? new StringLiteralExpr(value) : new NameExpr(value));
}
}
示例3: doMerge
import com.github.javaparser.ast.expr.MemberValuePair; //导入方法依赖的package包/类
@Override public MemberValuePair doMerge(MemberValuePair first, MemberValuePair second) {
MemberValuePair mvp = new MemberValuePair();
mvp.setName(first.getName());
mvp.setValue(mergeSingle(first.getValue(),second.getValue()));
return mvp;
}
示例4: visit
import com.github.javaparser.ast.expr.MemberValuePair; //导入方法依赖的package包/类
@Override public Node visit(final MemberValuePair n, final A arg) {
n.setValue((Expression) n.getValue().accept(this, arg));
return n;
}
示例5: visit
import com.github.javaparser.ast.expr.MemberValuePair; //导入方法依赖的package包/类
@Override public Node visit(final MemberValuePair n, final A arg) {
visitComment(n, arg);
n.setValue((Expression) n.getValue().accept(this, arg));
return n;
}