use of org.jdom.input.JDOMParseException in project intellij-community by JetBrains.
the class FormWordsScanner method processWords.
@Override
public void processWords(CharSequence fileText, final Processor<WordOccurrence> processor) {
super.processWords(fileText, processor);
try {
LwRootContainer container = Utils.getRootContainer(fileText.toString(), null);
String className = container.getClassToBind();
if (className != null) {
processClassAndPackagesNames(className, processor);
}
FormEditingUtil.iterate(container, new FormEditingUtil.ComponentVisitor() {
WordOccurrence occurence;
public boolean visit(IComponent iComponent) {
String componentClassName = iComponent.getComponentClassName();
processClassAndPackagesNames(componentClassName, processor);
final String binding = iComponent.getBinding();
if (binding != null) {
if (occurence == null)
occurence = new WordOccurrence(binding, 0, binding.length(), WordOccurrence.Kind.FOREIGN_LANGUAGE);
else
occurence.init(binding, 0, binding.length(), WordOccurrence.Kind.FOREIGN_LANGUAGE);
processor.process(occurence);
}
return true;
}
});
} catch (AlienFormFileException | JDOMParseException | UnexpectedFormElementException ex) {
// ignore
} catch (Exception e) {
LOG.error("Error indexing form file", e);
}
}
Aggregations