use of org.kohsuke.rngom.digested.DPattern in project intellij-community by JetBrains.
the class RngParser method getCachedPattern.
public static DPattern getCachedPattern(final PsiFile descriptorFile, final ErrorHandler eh) {
final VirtualFile file = descriptorFile.getVirtualFile();
if (file == null) {
return parsePattern(descriptorFile, eh, false);
}
String url = file.getUrl();
DPattern pattern = ourCache.get(url);
if (pattern == null) {
pattern = parsePattern(descriptorFile, eh, false);
}
if (pattern != null) {
DPattern oldPattern = ourCache.putIfAbsent(url, pattern);
if (oldPattern != null) {
return oldPattern;
}
}
return pattern;
}
use of org.kohsuke.rngom.digested.DPattern in project intellij-community by JetBrains.
the class CompositeDescriptor method collectAttributeDescriptors.
@Override
protected XmlAttributeDescriptor[] collectAttributeDescriptors(@Nullable XmlTag context) {
final QName qName = null;
final DPattern[] patterns;
if (qName == null) {
patterns = myPatterns;
} else {
final List<DElementPattern> p = ContainerUtil.findAll(myPatterns, pattern -> pattern.getName().contains(qName));
patterns = p.toArray(new DPattern[p.size()]);
}
return computeAttributeDescriptors(AttributeFinder.find(patterns));
}
Aggregations