public void emit() {
Class<? extends PatternBasedElementProcessor> processor = processorByTemplate.get(group(2));
if (processor == null) {
getBuilder().characters(group(1));
} else {
PatternBasedElementProcessor delegate;
try {
delegate = processor.newInstance();
} catch (Exception e) {
throw new IllegalStateException(e);
}
delegate.setLineStartOffset(getLineStartOffset());
delegate.setLineEndOffset(getLineEndOffset());
delegate.setParser(getParser());
delegate.setState(getState());
delegate.setGroup(1,group(1),start(1),end(1));
delegate.setGroup(2,group(2),start(2),end(2));
delegate.emit();
}
}