We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the parse method in the ActionStartEntryParser class there currently is this block of code:
parse
ActionStartEntryParser
//TODO clean this up Set<EntryParser> innerEntryParsers; try { innerEntryParsers = entryParsers.stream() .map(Object::getClass) .map(clazz -> { try { if (restrictIndentation) { if (clazz.equals(ActionStartEntryParser.class)) { Method method = clazz.getDeclaredMethod("createForIndentation", int.class, Set.class); return (EntryParser)method.invoke(null, indentation + 4, entryParsers); } Method method = clazz.getDeclaredMethod("createForIndentation", int.class); return (EntryParser)method.invoke(null, indentation + 4); } if (clazz.equals(ActionStartEntryParser.class)) { Method method = clazz.getDeclaredMethod("create", Set.class); return (EntryParser)method.invoke(null, entryParsers); } Method method = clazz.getDeclaredMethod("create"); return (EntryParser)method.invoke(null); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) { throw new RuntimeException(ex); } }) .collect(Collectors.toSet()); } catch (RuntimeException ex) { throw new NotParsableException(ex); }
The goal is to instantiate the supplied set of entry parsers with the correct indentation level.
The best solution may be to use a factory pattern and supply the factories instead.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In the
parse
method in theActionStartEntryParser
class there currently is this block of code:The goal is to instantiate the supplied set of entry parsers with the correct indentation level.
The best solution may be to use a factory pattern and supply the factories instead.
The text was updated successfully, but these errors were encountered: