mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
value patterns for attributes
This commit is contained in:
@@ -66,4 +66,13 @@ public class XmlAttributeValuePattern extends XmlElementPattern<XmlAttributeValu
|
||||
});
|
||||
}
|
||||
|
||||
public XmlAttributeValuePattern withValue(final StringPattern valuePattern) {
|
||||
return with(new PatternCondition<XmlAttributeValue>("withValue") {
|
||||
@Override
|
||||
public boolean accepts(@NotNull XmlAttributeValue xmlAttributeValue, ProcessingContext context) {
|
||||
return valuePattern.accepts(xmlAttributeValue.getValue(), context);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,6 +75,15 @@ public abstract class XmlNamedElementPattern<T extends XmlElement & PsiNamedElem
|
||||
protected String getNamespace(XmlAttribute xmlAttribute) {
|
||||
return xmlAttribute.getNamespace();
|
||||
}
|
||||
|
||||
public XmlAttributePattern withValue(final StringPattern pattern) {
|
||||
return with(new PatternCondition<XmlAttribute>("withValue") {
|
||||
@Override
|
||||
public boolean accepts(@NotNull XmlAttribute xmlAttribute, ProcessingContext context) {
|
||||
return pattern.accepts(xmlAttribute.getValue(), context);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user