ElementPattern<T> (final String text, final String displayName) { try { return compileElementPattern(text); } catch (Exception ex) { onCompilationFailed(displayName, text, ex); return new LazyPresentablePattern<>(new Node(ERROR_NODE, text, null), Collections.emptySet()); } }