本文整理汇总了Java中com.intellij.psi.PsiNewExpression.getArgumentList方法的典型用法代码示例。如果您正苦于以下问题:Java PsiNewExpression.getArgumentList方法的具体用法?Java PsiNewExpression.getArgumentList怎么用?Java PsiNewExpression.getArgumentList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.PsiNewExpression
的用法示例。
在下文中一共展示了PsiNewExpression.getArgumentList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitNewExpression
import com.intellij.psi.PsiNewExpression; //导入方法依赖的package包/类
@Override
public void visitNewExpression(@NotNull PsiNewExpression expression) {
super.visitNewExpression(expression);
if (!ExpressionUtils.hasType(expression, "java.text.SimpleDateFormat")) {
return;
}
final PsiExpressionList argumentList = expression.getArgumentList();
if (argumentList == null) {
return;
}
final PsiExpression[] arguments = argumentList.getExpressions();
for (PsiExpression argument : arguments) {
if (ExpressionUtils.hasType(argument, "java.util.Locale")) {
return;
}
}
registerNewExpressionError(expression);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SimpleDateFormatWithoutLocaleInspection.java
示例2: visitNewExpression
import com.intellij.psi.PsiNewExpression; //导入方法依赖的package包/类
@Override
public void visitNewExpression(@NotNull PsiNewExpression expression) {
super.visitNewExpression(expression);
final PsiType type = expression.getType();
if (type == null) {
return;
}
if (!CollectionUtils.isCollectionWithInitialCapacity(type)) {
return;
}
final PsiExpressionList argumentList = expression.getArgumentList();
if (argumentList == null) {
return;
}
final PsiExpression[] parameters = argumentList.getExpressions();
if (parameters.length != 0) {
return;
}
registerError(expression);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:CollectionsMustHaveInitialCapacityInspection.java
示例3: visitNewExpression
import com.intellij.psi.PsiNewExpression; //导入方法依赖的package包/类
@Override
public void visitNewExpression(@NotNull PsiNewExpression expression) {
super.visitNewExpression(expression);
if (!ExpressionUtils.hasType(expression, "java.text.SimpleDateFormat")) {
return;
}
final PsiExpressionList argumentList = expression.getArgumentList();
if (argumentList == null) {
return;
}
final PsiExpression[] arguments = argumentList.getExpressions();
for (PsiExpression argument : arguments) {
if (ExpressionUtils.hasType(argument, "java.util.Locale")) {
return;
}
}
registerError(expression);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:SimpleDateFormatWithoutLocaleInspection.java
示例4: visitNewExpression
import com.intellij.psi.PsiNewExpression; //导入方法依赖的package包/类
@Override
public void visitNewExpression(@NotNull PsiNewExpression newExpression) {
if (passed) {
return;
}
super.visitNewExpression(newExpression);
final PsiExpressionList argumentList = newExpression.getArgumentList();
if (argumentList == null) {
return;
}
final PsiExpression[] arguments = argumentList.getExpressions();
for (PsiExpression argument : arguments) {
if (VariableAccessUtils.mayEvaluateToVariable(argument, variable)) {
passed = true;
break;
}
}
}
示例5: visitNewExpression
import com.intellij.psi.PsiNewExpression; //导入方法依赖的package包/类
@Override
public void visitNewExpression(@NotNull PsiNewExpression expression)
{
super.visitNewExpression(expression);
if(myIgnoreFields && expression.getParent() instanceof PsiField)
{
return;
}
final PsiType type = expression.getType();
if(!isCollectionWithInitialCapacity(type))
{
return;
}
final PsiExpressionList argumentList = expression.getArgumentList();
if(argumentList == null || argumentList.getExpressions().length != 0)
{
return;
}
registerNewExpressionError(expression);
}
示例6: visitNewExpression
import com.intellij.psi.PsiNewExpression; //导入方法依赖的package包/类
@Override
public void visitNewExpression(@NotNull PsiNewExpression newExpression) {
if (passed) {
return;
}
super.visitNewExpression(newExpression);
final PsiExpressionList argumentList = newExpression.getArgumentList();
if (argumentList == null) {
return;
}
final PsiExpression[] arguments = argumentList.getExpressions();
for (PsiExpression argument : arguments) {
if (!VariableAccessUtils.mayEvaluateToVariable(argument, variable, myBuilderPattern)) {
continue;
}
final PsiMethod constructor = newExpression.resolveConstructor();
if (constructor != null) {
final PsiClass aClass = constructor.getContainingClass();
if (aClass != null) {
final String name = aClass.getQualifiedName();
if (excludes.contains(name)) {
continue;
}
}
}
passed = true;
}
}