mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-psi-api] add missing override PsiNameValuePairPattern.withName(ElementPattern<String>)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.intellij.patterns;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiNameValuePair;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -39,4 +40,18 @@ public class PsiNameValuePairPattern extends PsiElementPattern<PsiNameValuePair,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiNameValuePairPattern withName(@NotNull final ElementPattern<String> name) {
|
||||
return with(new PsiNamePatternCondition<PsiNameValuePair>("withName", name) {
|
||||
@Override
|
||||
public String getPropertyValue(@NotNull Object o) {
|
||||
if (o instanceof PsiNameValuePair) {
|
||||
final String nameValue = ((PsiNameValuePair)o).getName();
|
||||
return StringUtil.notNullize(nameValue, "value");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user