From 27bf571d6413c3cc6a5d664b5bddd38d21d7b1cd Mon Sep 17 00:00:00 2001 From: EVE Date: Mon, 13 Mar 2017 16:42:21 -0400 Subject: Formatting --- .../components/ComponentDescriptionFileParser.java | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java b/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java index ad5e1a2..22221d2 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java +++ b/BJC-Utils2/src/main/java/bjc/utils/components/ComponentDescriptionFileParser.java @@ -19,7 +19,8 @@ public class ComponentDescriptionFileParser { // Initialize the reader and its pragmas static { - // This reader works entirely off of pragmas, so no need to handle + // This reader works entirely off of pragmas, so no need to + // handle // rules reader = new RuleBasedConfigReader<>((tokenizer, statePair) -> { // Don't need to do anything on rule start @@ -36,17 +37,15 @@ public class ComponentDescriptionFileParser { * Parse a component description from a stream * * @param inputSource - * The stream to parse from + * The stream to parse from * @return The description parsed from the stream */ - public static ComponentDescription fromStream( - InputStream inputSource) { - if(inputSource == null) { + public static ComponentDescription fromStream(InputStream inputSource) { + if (inputSource == null) { throw new NullPointerException("Input source must not be null"); } - - ComponentDescriptionState readState = reader - .fromStream(inputSource, new ComponentDescriptionState()); + + ComponentDescriptionState readState = reader.fromStream(inputSource, new ComponentDescriptionState()); return readState.toDescription(); } @@ -55,17 +54,13 @@ public class ComponentDescriptionFileParser { * Create all the pragmas the reader needs to function */ private static void setupReaderPragmas() { - reader.addPragma("name", buildStringCollapser("name", - (name, state) -> state.setName(name))); + reader.addPragma("name", buildStringCollapser("name", (name, state) -> state.setName(name))); - reader.addPragma("author", buildStringCollapser("author", - (author, state) -> state.setAuthor(author))); + reader.addPragma("author", buildStringCollapser("author", (author, state) -> state.setAuthor(author))); - reader.addPragma("description", - buildStringCollapser("description", (description, - state) -> state.setDescription(description))); + reader.addPragma("description", buildStringCollapser("description", + (description, state) -> state.setDescription(description))); - reader.addPragma("version", buildInteger("version", - (version, state) -> state.setVersion(version))); + reader.addPragma("version", buildInteger("version", (version, state) -> state.setVersion(version))); } } -- cgit v1.2.3