本文整理汇总了Java中com.sun.source.tree.CompoundAssignmentTree.getVariable方法的典型用法代码示例。如果您正苦于以下问题:Java CompoundAssignmentTree.getVariable方法的具体用法?Java CompoundAssignmentTree.getVariable怎么用?Java CompoundAssignmentTree.getVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.source.tree.CompoundAssignmentTree
的用法示例。
在下文中一共展示了CompoundAssignmentTree.getVariable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitCompoundAssignment
import com.sun.source.tree.CompoundAssignmentTree; //导入方法依赖的package包/类
@Override
public Void visitCompoundAssignment(CompoundAssignmentTree node, Void p) {
ExpressionTree var = node.getVariable();
ExpressionTree expr = node.getExpression();
AnnotatedTypeMirror varType = atypeFactory.getAnnotatedType(var);
AnnotatedTypeMirror exprType = atypeFactory.getAnnotatedType(expr);
Kind kind = node.getKind();
if ( (kind == Kind.PLUS_ASSIGNMENT || kind == Kind.MINUS_ASSIGNMENT)) {
if (!atypeFactory.getTypeHierarchy().isSubtype(exprType, varType)) {
checker.report(Result.failure("compound.assignment.type.incompatible",
varType, exprType), node);
}
} else if (exprType.getAnnotation(UnknownUnits.class) == null) {
// Only allow mul/div with unqualified units
checker.report(Result.failure("compound.assignment.type.incompatible",
varType, exprType), node);
}
return null; // super.visitCompoundAssignment(node, p);
}
示例2: visitCompoundAssignment
import com.sun.source.tree.CompoundAssignmentTree; //导入方法依赖的package包/类
@Override
public PurityResult visitCompoundAssignment(
CompoundAssignmentTree node, PurityResult p) {
ExpressionTree variable = node.getVariable();
p = assignmentCheck(p, variable);
PurityResult r = scan(variable, p);
r = scan(node.getExpression(), r);
return r;
}
示例3: visitCompoundAssignment
import com.sun.source.tree.CompoundAssignmentTree; //导入方法依赖的package包/类
@Override
public Void visitCompoundAssignment(CompoundAssignmentTree node, AnnotatedTypeMirror type) {
ExpressionTree var = node.getVariable();
AnnotatedTypeMirror varType = getAnnotatedType(var);
type.replaceAnnotations(varType.getAnnotations());
return super.visitCompoundAssignment(node, type);
}
示例4: visitCompoundAssignment
import com.sun.source.tree.CompoundAssignmentTree; //导入方法依赖的package包/类
@Override
public PurityResult visitCompoundAssignment(CompoundAssignmentTree node, PurityResult p) {
ExpressionTree variable = node.getVariable();
p = assignmentCheck(p, variable);
PurityResult r = scan(variable, p);
r = scan(node.getExpression(), r);
return r;
}