From b2d050b59caf4874c8bb6eb375237e195274fcd9 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 8 Apr 2017 12:09:49 +0300 Subject: [PATCH 01/16] [maven-release-plugin] prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 570fa31..3176a06 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 eu.svjatoslav svjatoslavcommons - 1.6 + 1.7-SNAPSHOT jar Svjatoslav Commons Collection many small but commonly useful functionalities -- 2.20.1 From 7e174ea3fd35f3c5d6b9609adc788942ede68b78 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 11 Apr 2017 10:10:11 +0300 Subject: [PATCH 02/16] Revert "[maven-release-plugin] prepare for next development iteration" This reverts commit b2d050b59caf4874c8bb6eb375237e195274fcd9. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3176a06..570fa31 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 eu.svjatoslav svjatoslavcommons - 1.7-SNAPSHOT + 1.6 jar Svjatoslav Commons Collection many small but commonly useful functionalities -- 2.20.1 From 9bb1d0be2d78629544b3fca95860990108825550 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 11 Apr 2017 10:10:24 +0300 Subject: [PATCH 03/16] Revert "[maven-release-plugin] prepare release svjatoslavcommons-1.6" This reverts commit c04f0c168f78739d2dc75225f93c13c5baa1548b. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 570fa31..51b2a58 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 eu.svjatoslav svjatoslavcommons - 1.6 + 1.6-SNAPSHOT jar Svjatoslav Commons Collection many small but commonly useful functionalities -- 2.20.1 From 6846681d727a07385bcd3e0eb856f70a7e96448c Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 23 Jun 2017 14:21:25 +0200 Subject: [PATCH 04/16] Updated copyright --- src/main/java/eu/svjatoslav/commons/commandline/CLIHelper.java | 2 +- .../commons/commandline/parameterparser/ArgumentCount.java | 2 +- .../commons/commandline/parameterparser/Parameter.java | 2 +- .../svjatoslav/commons/commandline/parameterparser/Parser.java | 2 +- .../parameterparser/parameter/DirectoryParameter.java | 2 +- .../commandline/parameterparser/parameter/ExistenceType.java | 2 +- .../commandline/parameterparser/parameter/FileParameter.java | 2 +- .../commandline/parameterparser/parameter/IntegerParameter.java | 2 +- .../commandline/parameterparser/parameter/NullParameter.java | 2 +- .../commandline/parameterparser/parameter/StringParameter.java | 2 +- .../commandline/parameterparser/parameter/StringParameters.java | 2 +- src/main/java/eu/svjatoslav/commons/data/BitInputStream.java | 2 +- src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java | 2 +- .../eu/svjatoslav/commons/data/EnhancedDataInputStream.java | 2 +- .../eu/svjatoslav/commons/data/EnhancedDataOutputStream.java | 2 +- src/main/java/eu/svjatoslav/commons/data/HexConverter.java | 2 +- .../java/eu/svjatoslav/commons/file/CommonPathResolver.java | 2 +- src/main/java/eu/svjatoslav/commons/file/FilePathParser.java | 2 +- src/main/java/eu/svjatoslav/commons/file/IOHelper.java | 2 +- .../java/eu/svjatoslav/commons/gui/dialog/ExceptionDialog.java | 2 +- .../java/eu/svjatoslav/commons/network/LocaleConfiguration.java | 2 +- .../eu/svjatoslav/commons/network/navigation/Navigation.java | 2 +- .../svjatoslav/commons/network/navigation/NavigationItem.java | 2 +- src/main/java/eu/svjatoslav/commons/string/String2.java | 2 +- src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java | 2 +- .../commons/string/tokenizer/InvalidSyntaxException.java | 2 +- .../java/eu/svjatoslav/commons/string/tokenizer/Terminator.java | 2 +- .../java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java | 2 +- .../eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java | 2 +- .../commons/commandline/parameterparser/ParserTest.java | 2 +- src/test/java/eu/svjatoslav/commons/data/HexConverterTest.java | 2 +- .../java/eu/svjatoslav/commons/file/CommonPathResolverTest.java | 2 +- src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java | 2 +- src/test/java/eu/svjatoslav/commons/string/String2Test.java | 2 +- .../java/eu/svjatoslav/commons/string/WildCardMatcherTest.java | 2 +- svjatoslavcommons.iml | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/main/java/eu/svjatoslav/commons/commandline/CLIHelper.java b/src/main/java/eu/svjatoslav/commons/commandline/CLIHelper.java index be7e525..d6ec3ec 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/CLIHelper.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/CLIHelper.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/ArgumentCount.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/ArgumentCount.java index d75b827..867be11 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/ArgumentCount.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/ArgumentCount.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parameter.java index 8141339..6e29ba6 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parameter.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parser.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parser.java index 63a95f9..ff15a4e 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parser.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parser.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/DirectoryParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/DirectoryParameter.java index f12ee98..0cdf852 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/DirectoryParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/DirectoryParameter.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/ExistenceType.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/ExistenceType.java index b3e2211..d03f25a 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/ExistenceType.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/ExistenceType.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/FileParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/FileParameter.java index b98189c..609b25a 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/FileParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/FileParameter.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/IntegerParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/IntegerParameter.java index ad0bf2c..e8a3cfe 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/IntegerParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/IntegerParameter.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/NullParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/NullParameter.java index cf175bf..e082ac1 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/NullParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/NullParameter.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameter.java index 2321434..47f3762 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameter.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameters.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameters.java index 336e345..5fcdf69 100644 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameters.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameters.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/data/BitInputStream.java b/src/main/java/eu/svjatoslav/commons/data/BitInputStream.java index a6ac691..664ffcb 100755 --- a/src/main/java/eu/svjatoslav/commons/data/BitInputStream.java +++ b/src/main/java/eu/svjatoslav/commons/data/BitInputStream.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java b/src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java index b356ea0..e5f4934 100755 --- a/src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java +++ b/src/main/java/eu/svjatoslav/commons/data/BitOutputStream.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/data/EnhancedDataInputStream.java b/src/main/java/eu/svjatoslav/commons/data/EnhancedDataInputStream.java index 45fcaf5..77cd97e 100755 --- a/src/main/java/eu/svjatoslav/commons/data/EnhancedDataInputStream.java +++ b/src/main/java/eu/svjatoslav/commons/data/EnhancedDataInputStream.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/data/EnhancedDataOutputStream.java b/src/main/java/eu/svjatoslav/commons/data/EnhancedDataOutputStream.java index d202ba6..a74c522 100755 --- a/src/main/java/eu/svjatoslav/commons/data/EnhancedDataOutputStream.java +++ b/src/main/java/eu/svjatoslav/commons/data/EnhancedDataOutputStream.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/data/HexConverter.java b/src/main/java/eu/svjatoslav/commons/data/HexConverter.java index a10472f..d4aaec1 100755 --- a/src/main/java/eu/svjatoslav/commons/data/HexConverter.java +++ b/src/main/java/eu/svjatoslav/commons/data/HexConverter.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/file/CommonPathResolver.java b/src/main/java/eu/svjatoslav/commons/file/CommonPathResolver.java index 04a2fe9..65434ef 100755 --- a/src/main/java/eu/svjatoslav/commons/file/CommonPathResolver.java +++ b/src/main/java/eu/svjatoslav/commons/file/CommonPathResolver.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/file/FilePathParser.java b/src/main/java/eu/svjatoslav/commons/file/FilePathParser.java index 905ea22..caf0d29 100755 --- a/src/main/java/eu/svjatoslav/commons/file/FilePathParser.java +++ b/src/main/java/eu/svjatoslav/commons/file/FilePathParser.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/file/IOHelper.java b/src/main/java/eu/svjatoslav/commons/file/IOHelper.java index e83561a..5ea2a6c 100755 --- a/src/main/java/eu/svjatoslav/commons/file/IOHelper.java +++ b/src/main/java/eu/svjatoslav/commons/file/IOHelper.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/gui/dialog/ExceptionDialog.java b/src/main/java/eu/svjatoslav/commons/gui/dialog/ExceptionDialog.java index d4bf2f5..8a2886e 100755 --- a/src/main/java/eu/svjatoslav/commons/gui/dialog/ExceptionDialog.java +++ b/src/main/java/eu/svjatoslav/commons/gui/dialog/ExceptionDialog.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/network/LocaleConfiguration.java b/src/main/java/eu/svjatoslav/commons/network/LocaleConfiguration.java index 7e5ee06..447f530 100755 --- a/src/main/java/eu/svjatoslav/commons/network/LocaleConfiguration.java +++ b/src/main/java/eu/svjatoslav/commons/network/LocaleConfiguration.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/network/navigation/Navigation.java b/src/main/java/eu/svjatoslav/commons/network/navigation/Navigation.java index 963b341..e4d35a3 100755 --- a/src/main/java/eu/svjatoslav/commons/network/navigation/Navigation.java +++ b/src/main/java/eu/svjatoslav/commons/network/navigation/Navigation.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/network/navigation/NavigationItem.java b/src/main/java/eu/svjatoslav/commons/network/navigation/NavigationItem.java index 16e0708..0edc44e 100755 --- a/src/main/java/eu/svjatoslav/commons/network/navigation/NavigationItem.java +++ b/src/main/java/eu/svjatoslav/commons/network/navigation/NavigationItem.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/string/String2.java b/src/main/java/eu/svjatoslav/commons/string/String2.java index 37ee8e9..113f67e 100755 --- a/src/main/java/eu/svjatoslav/commons/string/String2.java +++ b/src/main/java/eu/svjatoslav/commons/string/String2.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java b/src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java index 0da1738..9fe2bb5 100755 --- a/src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java +++ b/src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/InvalidSyntaxException.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/InvalidSyntaxException.java index e68fef0..e63c035 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/InvalidSyntaxException.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/InvalidSyntaxException.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java index bea98bb..f0a3fd1 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java index 1905d9a..8b396ed 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java index b4279ce..92997dd 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/test/java/eu/svjatoslav/commons/commandline/parameterparser/ParserTest.java b/src/test/java/eu/svjatoslav/commons/commandline/parameterparser/ParserTest.java index c5fcda4..330eb18 100755 --- a/src/test/java/eu/svjatoslav/commons/commandline/parameterparser/ParserTest.java +++ b/src/test/java/eu/svjatoslav/commons/commandline/parameterparser/ParserTest.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/test/java/eu/svjatoslav/commons/data/HexConverterTest.java b/src/test/java/eu/svjatoslav/commons/data/HexConverterTest.java index 92fc0e6..50b802b 100755 --- a/src/test/java/eu/svjatoslav/commons/data/HexConverterTest.java +++ b/src/test/java/eu/svjatoslav/commons/data/HexConverterTest.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/test/java/eu/svjatoslav/commons/file/CommonPathResolverTest.java b/src/test/java/eu/svjatoslav/commons/file/CommonPathResolverTest.java index 8750f89..84eee59 100755 --- a/src/test/java/eu/svjatoslav/commons/file/CommonPathResolverTest.java +++ b/src/test/java/eu/svjatoslav/commons/file/CommonPathResolverTest.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java b/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java index c83517f..d23943f 100755 --- a/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java +++ b/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/test/java/eu/svjatoslav/commons/string/String2Test.java b/src/test/java/eu/svjatoslav/commons/string/String2Test.java index db1c121..35e203b 100755 --- a/src/test/java/eu/svjatoslav/commons/string/String2Test.java +++ b/src/test/java/eu/svjatoslav/commons/string/String2Test.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/src/test/java/eu/svjatoslav/commons/string/WildCardMatcherTest.java b/src/test/java/eu/svjatoslav/commons/string/WildCardMatcherTest.java index a677bb7..6537fbc 100755 --- a/src/test/java/eu/svjatoslav/commons/string/WildCardMatcherTest.java +++ b/src/test/java/eu/svjatoslav/commons/string/WildCardMatcherTest.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License diff --git a/svjatoslavcommons.iml b/svjatoslavcommons.iml index b1fdb56..526b60f 100644 --- a/svjatoslavcommons.iml +++ b/svjatoslavcommons.iml @@ -1,6 +1,6 @@ - + -- 2.20.1 From 41647e2ea4fbbe65049d79c6b2bc73ecdd2a193c Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 23 Jun 2017 15:00:57 +0200 Subject: [PATCH 05/16] Improved generics usage. --- .../parameterparser/Parameter.java | 28 +++++++------- .../commandline/parameterparser/Parser.java | 20 +++++----- .../parameter/DirectoryParameter.java | 2 +- .../parameter/FileParameter.java | 2 +- .../parameter/IntegerParameter.java | 2 +- .../parameter/NullParameter.java | 4 +- .../parameter/StringParameter.java | 2 +- .../parameter/StringParameters.java | 2 +- .../parameterparser/ParserTest.java | 38 ++++++++++++++----- 9 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parameter.java index 6e29ba6..d55407b 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parameter.java @@ -12,11 +12,11 @@ package eu.svjatoslav.commons.commandline.parameterparser; import java.util.ArrayList; import java.util.Collections; -public abstract class Parameter { +public abstract class Parameter { - public final String description; + public String description; public final ArrayList arguments = new ArrayList<>(); - final ArgumentCount argumentCount; + ArgumentCount argumentCount; private final ArrayList aliases = new ArrayList<>(); /** * Indicates that at least one argument is mandatory for this parameter. @@ -26,7 +26,7 @@ public abstract class Parameter { * If this parameter was present in the commandline, then this boolean will * be set to true. */ - private boolean parameterSpecified; + private boolean specified; public Parameter(final boolean mandatory, final ArgumentCount argumentCount, final String description, @@ -47,12 +47,12 @@ public abstract class Parameter { } @SuppressWarnings("unchecked") - public T addAliases(final String... aliasArray) { + public I addAliases(final String... aliasArray) { // save aliases Collections.addAll(aliases, aliasArray); - return (T) this; + return (I)this; } /** @@ -129,7 +129,7 @@ public abstract class Parameter { return buffer.toString(); } - public abstract Object getValue(); + public abstract T getValue(); public boolean isMandatory() { return mandatory; @@ -138,15 +138,15 @@ public abstract class Parameter { /** * @return the parameterSpecified */ - public boolean isParameterSpecified() { - return parameterSpecified; + public boolean isSpecified() { + return specified; } /** - * @param parameterSpecified the parameterSpecified to set + * @param specified the parameterSpecified to set */ - public void setParameterSpecified(final boolean parameterSpecified) { - this.parameterSpecified = parameterSpecified; + protected void setSpecified(final boolean specified) { + this.specified = specified; } /** @@ -180,9 +180,9 @@ public abstract class Parameter { } @SuppressWarnings("unchecked") - public T setMandatory() { + public I setMandatory() { mandatory = true; - return (T) this; + return (I)this; } /** diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parser.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parser.java index ff15a4e..3094403 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parser.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/Parser.java @@ -18,9 +18,9 @@ import java.util.ArrayList; */ public class Parser { - private final ArrayList> parameters = new ArrayList<>(); + private final ArrayList> parameters = new ArrayList<>(); - public > E add(final E parameter) { + public E add(final E parameter) { parameters.add(parameter); return parameter; } @@ -31,8 +31,8 @@ public class Parser { */ private boolean checkMandatoryArgumentsPresent() { - for (final Parameter parameter : parameters) - if (parameter.isMandatory() && (!parameter.isParameterSpecified())) { + for (final Parameter parameter : parameters) + if (parameter.isMandatory() && (!parameter.isSpecified())) { System.out.println("Error! Mandatory parameter (" + parameter.getAliases() + ") is not specified."); return false; @@ -48,9 +48,9 @@ public class Parser { * @param alias parameter alias * @return found parameter or null if parameter was not found. */ - public Parameter findParameterByAlias(final String alias) { + public Parameter findParameterByAlias(final String alias) { - for (final Parameter parameter : parameters) + for (final Parameter parameter : parameters) if (parameter.matchesAlias(alias)) return parameter; @@ -64,11 +64,11 @@ public class Parser { */ public boolean parse(final String[] args) { - Parameter currentParameter = null; + Parameter currentParameter = null; for (final String argument : args) { - final Parameter parameterForAlias = findParameterByAlias(argument); + final Parameter parameterForAlias = findParameterByAlias(argument); if (parameterForAlias == null) { if (currentParameter == null) { System.out.println("Unknown commandline parameter: " @@ -84,7 +84,7 @@ public class Parser { if (!currentParameter.noMoreArguments()) return false; - parameterForAlias.setParameterSpecified(true); + parameterForAlias.setSpecified(true); currentParameter = parameterForAlias; } @@ -94,7 +94,7 @@ public class Parser { } public void showHelp() { - for (final Parameter parameter : parameters) + for (final Parameter parameter : parameters) System.out.println(parameter.getHelp()); } diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/DirectoryParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/DirectoryParameter.java index 0cdf852..1832334 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/DirectoryParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/DirectoryParameter.java @@ -14,7 +14,7 @@ import eu.svjatoslav.commons.commandline.parameterparser.Parameter; import java.io.File; -public class DirectoryParameter extends Parameter { +public class DirectoryParameter extends Parameter { private ExistenceType existenceType = ExistenceType.DOES_NOT_MATTER; diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/FileParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/FileParameter.java index 609b25a..fc8c450 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/FileParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/FileParameter.java @@ -14,7 +14,7 @@ import eu.svjatoslav.commons.commandline.parameterparser.Parameter; import java.io.File; -public class FileParameter extends Parameter { +public class FileParameter extends Parameter { private ExistenceType existenceType = ExistenceType.DOES_NOT_MATTER; diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/IntegerParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/IntegerParameter.java index e8a3cfe..6daa894 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/IntegerParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/IntegerParameter.java @@ -12,7 +12,7 @@ package eu.svjatoslav.commons.commandline.parameterparser.parameter; import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount; import eu.svjatoslav.commons.commandline.parameterparser.Parameter; -public class IntegerParameter extends Parameter { +public class IntegerParameter extends Parameter { public IntegerParameter(final String description) { super(description, ArgumentCount.SINGLE); diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/NullParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/NullParameter.java index e082ac1..97c1c79 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/NullParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/NullParameter.java @@ -12,7 +12,7 @@ package eu.svjatoslav.commons.commandline.parameterparser.parameter; import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount; import eu.svjatoslav.commons.commandline.parameterparser.Parameter; -public class NullParameter extends Parameter { +public class NullParameter extends Parameter { public NullParameter(final String description) { super(description, ArgumentCount.NONE); @@ -25,7 +25,7 @@ public class NullParameter extends Parameter { @Override public Boolean getValue() { - return isParameterSpecified(); + return isSpecified(); } @Override diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameter.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameter.java index 47f3762..64c56fc 100755 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameter.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameter.java @@ -12,7 +12,7 @@ package eu.svjatoslav.commons.commandline.parameterparser.parameter; import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount; import eu.svjatoslav.commons.commandline.parameterparser.Parameter; -public class StringParameter extends Parameter { +public class StringParameter extends Parameter { public StringParameter(final String description) { super(description, ArgumentCount.SINGLE); diff --git a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameters.java b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameters.java index 5fcdf69..1287186 100644 --- a/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameters.java +++ b/src/main/java/eu/svjatoslav/commons/commandline/parameterparser/parameter/StringParameters.java @@ -14,7 +14,7 @@ import eu.svjatoslav.commons.commandline.parameterparser.Parameter; import java.util.List; -public class StringParameters extends Parameter { +public class StringParameters extends Parameter, StringParameters> { public StringParameters(final String description) { super(description, ArgumentCount.MULTI); diff --git a/src/test/java/eu/svjatoslav/commons/commandline/parameterparser/ParserTest.java b/src/test/java/eu/svjatoslav/commons/commandline/parameterparser/ParserTest.java index 330eb18..5df31b9 100755 --- a/src/test/java/eu/svjatoslav/commons/commandline/parameterparser/ParserTest.java +++ b/src/test/java/eu/svjatoslav/commons/commandline/parameterparser/ParserTest.java @@ -9,10 +9,15 @@ package eu.svjatoslav.commons.commandline.parameterparser; +import eu.svjatoslav.commons.commandline.parameterparser.parameter.FileParameter; import eu.svjatoslav.commons.commandline.parameterparser.parameter.StringParameter; import org.junit.Before; import org.junit.Test; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + import static org.junit.Assert.*; public class ParserTest { @@ -25,31 +30,44 @@ public class ParserTest { } @Test - public void testParse() { + public void testParse() throws IOException { // define allowed parameters - final StringParameter helpParameter = parser - .add(new StringParameter("Show help screen")) - .addAliases("--help", "-h").setMandatory(); + final StringParameter helpParameter = parser.add(new StringParameter("Show help screen") + .addAliases("--help", "-h").setMandatory()); + + final StringParameter compileParameter = parser.add(new StringParameter("Compile code")) + .addAliases("--compile", "-c"); + + FileParameter fileParameter = parser.add(new FileParameter("Input file") + .addAliases("-i").mustExist()); - final StringParameter compileParameter = parser.add( - new StringParameter("Compile code")).addAliases("--compile", - "-c"); + createTemporaryFile(); // check help generation parser.showHelp(); // parse arguments - parser.parse(new String[]{"--help", "section"}); + parser.parse(new String[]{"--help", "section", "-i", "/tmp/file with spaces"}); // --help was in the arguments - assertTrue(helpParameter.isParameterSpecified()); + assertTrue(helpParameter.isSpecified()); // compile was not present - assertFalse(compileParameter.isParameterSpecified()); + assertFalse(compileParameter.isSpecified()); // validate that help argument was "section" assertEquals("section", helpParameter.getValue()); + assertTrue(fileParameter.isSpecified()); + assertEquals("/tmp/file with spaces", fileParameter.getValue().getAbsolutePath()); + + } + + private void createTemporaryFile() throws IOException { + File fileWithSpaces = new File("/tmp/file with spaces"); + FileWriter writer = new FileWriter(fileWithSpaces); + writer.write("test"); + writer.close(); } } -- 2.20.1 From f097ecc7b13c2ff6d51342168718348119d7dfdb Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 7 Jul 2017 15:09:29 +0200 Subject: [PATCH 06/16] Updated documentation theme, version number and fixed broken link. --- doc/index.html | 350 ++++++++++++++++++++++++++++--------------------- doc/index.org | 14 +- 2 files changed, 215 insertions(+), 149 deletions(-) diff --git a/doc/index.html b/doc/index.html index 61599bf..b45b92d 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,154 +1,202 @@ - - - + + Svjatoslav Commons - Java library of commonly used functions - - - - + + + + + + + +" + - -
-

Svjatoslav Commons - Java library of commonly used functions

-
-

Table of Contents

- -
-
+
+

Svjatoslav Commons - Java library of commonly used functions

+
-
  • other applications hosted at svjatoslav.eu +
  • other applications hosted at svjatoslav.eu
  • @@ -246,7 +294,7 @@ Maven pom.xml file snippet: <dependency> <groupId>eu.svjatoslav</groupId> <artifactId>svjatoslavcommons</artifactId> - <version>1.4</version> + <version>1.5</version> </dependency> ... </dependencies> @@ -265,12 +313,20 @@ Maven pom.xml file snippet:
    +
    +
    +
    +

    Author: Svjatoslav Agejenko

    +

    Created: 2017-07-07 Fri 15:08

    +

    Emacs 25.1.1 (Org-mode 8.2.10)

    +
    diff --git a/doc/index.org b/doc/index.org index cfb8b4b..2e52a06 100644 --- a/doc/index.org +++ b/doc/index.org @@ -12,7 +12,17 @@ - Homepage: http://svjatoslav.eu - Email: mailto://svjatoslav@svjatoslav.eu -- [[http://svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]] +- [[http://www.svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]] + +* (document settings) :noexport: +** use dark style for TWBS-HTML exporter +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: " +#+HTML_HEAD: * General Library contains: @@ -56,7 +66,7 @@ Maven pom.xml file snippet: eu.svjatoslav svjatoslavcommons - 1.4 + 1.5 ... -- 2.20.1 From 83ac545c91eacfb24531396bdac5558dad7c10f5 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 11 Jul 2017 05:17:03 +0200 Subject: [PATCH 07/16] Fix for maven-git integration problem --- pom.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pom.xml b/pom.xml index 51b2a58..aa9ad66 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,19 @@ + + org.apache.maven.plugins + maven-release-plugin + 2.5.2 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.9.4 + + + + -- 2.20.1 From a338e6716fcfe8a78692c4d803ec6a51d50b20a7 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 15:05:18 +0300 Subject: [PATCH 08/16] Made it possible to reuse Tokenizer. Simplified Tokenizer building. --- pom.xml | 2 +- .../commons/string/tokenizer/Tokenizer.java | 22 ++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index aa9ad66..4ac08fe 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 eu.svjatoslav svjatoslavcommons - 1.6-SNAPSHOT + 1.7-SNAPSHOT jar Svjatoslav Commons Collection many small but commonly useful functionalities diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java index 8b396ed..a89677b 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java @@ -17,22 +17,32 @@ public class Tokenizer { final Stack tokenIndexes = new Stack<>(); private final List terminators = new ArrayList<>(); - private final String source; + private String source; private int currentIndex = 0; public Tokenizer(final String source) { this.source = source; } - public void addTerminator(final String startSequence, - final boolean ignoreTerminator) { + public Tokenizer(){} + + public Tokenizer setSource(String source){ + this.source = source; + currentIndex = 0; + return this; + } + + public Tokenizer addTerminator(final String startSequence, + final boolean ignoreTerminator) { terminators.add(new Terminator(startSequence, ignoreTerminator)); + return this; } - public void addTerminator(final String startSequence, - final String endSequence, final boolean ignoreTerminator) { + public Tokenizer addTerminator(final String startSequence, + final String endSequence, final boolean ignoreTerminator) { terminators.add(new Terminator(startSequence, endSequence, ignoreTerminator)); + return this; } public void expectNextToken(final String value) @@ -85,7 +95,7 @@ public class Tokenizer { } - public boolean probeNextToken(final String token) { + public boolean isNextToken(final String token) { if (token.equals(getNextToken().token)) return true; -- 2.20.1 From 0b3d733f44e95ee093985531072a1f8965f7c09a Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 16:58:55 +0300 Subject: [PATCH 09/16] Better code readability. --- .../commons/string/tokenizer/Terminator.java | 16 +++++++++------- .../commons/string/tokenizer/Tokenizer.java | 15 ++++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java index f0a3fd1..2d0fd45 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java @@ -12,20 +12,22 @@ package eu.svjatoslav.commons.string.tokenizer; public class Terminator { final String startSequence; - final boolean ignoreTerminator; String endSequence; + TerminationStrategy termination; - public Terminator(final String startPattern, final boolean ignoreTerminator) { + public Terminator(final String startPattern, TerminationStrategy termination) { startSequence = startPattern; - this.ignoreTerminator = ignoreTerminator; + this.termination = termination; } - public Terminator(final String startSequence, final String endSequence, - final boolean ignoreTerminator) { - + public Terminator(final String startSequence, final String endSequence, TerminationStrategy termination) { this.startSequence = startSequence; this.endSequence = endSequence; - this.ignoreTerminator = ignoreTerminator; + this.termination = termination; } + enum TerminationStrategy { + PRESERVE, + DROP; + } } diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java index a89677b..899f8c4 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java @@ -13,6 +13,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Stack; +import static eu.svjatoslav.commons.string.tokenizer.Terminator.TerminationStrategy.DROP; + public class Tokenizer { final Stack tokenIndexes = new Stack<>(); @@ -33,15 +35,14 @@ public class Tokenizer { } public Tokenizer addTerminator(final String startSequence, - final boolean ignoreTerminator) { - terminators.add(new Terminator(startSequence, ignoreTerminator)); + final Terminator.TerminationStrategy terminationStrategy) { + terminators.add(new Terminator(startSequence, terminationStrategy)); return this; } public Tokenizer addTerminator(final String startSequence, - final String endSequence, final boolean ignoreTerminator) { - terminators.add(new Terminator(startSequence, endSequence, - ignoreTerminator)); + final String endSequence, final Terminator.TerminationStrategy terminationStrategy) { + terminators.add(new Terminator(startSequence, endSequence, terminationStrategy)); return this; } @@ -66,7 +67,7 @@ public class Tokenizer { for (final Terminator terminator : terminators) if (sequenceMatches(terminator.startSequence)) - if (terminator.ignoreTerminator) { + if (terminator.termination == DROP) { currentIndex += terminator.startSequence.length(); if (terminator.endSequence != null) @@ -95,7 +96,7 @@ public class Tokenizer { } - public boolean isNextToken(final String token) { + public boolean consumeIfNextToken(final String token) { if (token.equals(getNextToken().token)) return true; -- 2.20.1 From 6fe5e2d632264f5cda3995e761342713f16d95f3 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 17:01:45 +0300 Subject: [PATCH 10/16] Make termination strategy public. --- .../eu/svjatoslav/commons/string/tokenizer/Terminator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java index 2d0fd45..39718cd 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java @@ -26,8 +26,8 @@ public class Terminator { this.termination = termination; } - enum TerminationStrategy { + public enum TerminationStrategy { PRESERVE, - DROP; + DROP } } -- 2.20.1 From 84d27634f0fabc23040c258d00b03ff8378c2e77 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 17:23:24 +0300 Subject: [PATCH 11/16] Make terminator details immutable and public. --- .../commons/string/tokenizer/Terminator.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java index 39718cd..ae51c29 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java @@ -11,12 +11,13 @@ package eu.svjatoslav.commons.string.tokenizer; public class Terminator { - final String startSequence; - String endSequence; - TerminationStrategy termination; + public final String startSequence; + public final String endSequence; + public final TerminationStrategy termination; - public Terminator(final String startPattern, TerminationStrategy termination) { - startSequence = startPattern; + public Terminator(final String startSequence, TerminationStrategy termination) { + this.startSequence = startSequence; + this.endSequence = null; this.termination = termination; } -- 2.20.1 From fac4a7627b6496ff15c113adf6eaf2929520c043 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 17:36:05 +0300 Subject: [PATCH 12/16] Possibility to peek next value. --- .../commons/string/tokenizer/Tokenizer.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java index 899f8c4..ba1590d 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java @@ -104,6 +104,23 @@ public class Tokenizer { return false; } + public TokenizerMatch peekNextToken(){ + TokenizerMatch result = getNextToken(); + unreadToken(); + return result; + } + + public boolean peekIsOneOf(String [] ... possibilities){ + TokenizerMatch nextToken = peekNextToken(); + + for (String[] possibility : possibilities) + if (possibility.equals(nextToken)) + return true; + + return false; + } + + public boolean sequenceMatches(final String sequence) { if ((currentIndex + sequence.length()) > source.length()) return false; -- 2.20.1 From 7c46b3418fe1061183aa204a17e38227762c6979 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 17:44:32 +0300 Subject: [PATCH 13/16] Added validation while peeking. --- .../eu/svjatoslav/commons/string/tokenizer/Tokenizer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java index ba1590d..cd5e5c0 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java @@ -120,6 +120,14 @@ public class Tokenizer { return false; } + public void peekExpectNoneOf(String [] ... possibilities) throws InvalidSyntaxException { + TokenizerMatch nextToken = peekNextToken(); + + for (String[] possibility : possibilities) + if (possibility.equals(nextToken)) + throw new InvalidSyntaxException("Not expected \"" + nextToken + "\" here."); + } + public boolean sequenceMatches(final String sequence) { if ((currentIndex + sequence.length()) > source.length()) -- 2.20.1 From fb5f728420aaf7bd108d39db12e2fec8113f9e77 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 17:46:56 +0300 Subject: [PATCH 14/16] Typo fix. --- .../eu/svjatoslav/commons/string/tokenizer/Tokenizer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java index cd5e5c0..4855c18 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java @@ -110,20 +110,20 @@ public class Tokenizer { return result; } - public boolean peekIsOneOf(String [] ... possibilities){ + public boolean peekIsOneOf(String ... possibilities){ TokenizerMatch nextToken = peekNextToken(); - for (String[] possibility : possibilities) + for (String possibility : possibilities) if (possibility.equals(nextToken)) return true; return false; } - public void peekExpectNoneOf(String [] ... possibilities) throws InvalidSyntaxException { + public void peekExpectNoneOf(String ... possibilities) throws InvalidSyntaxException { TokenizerMatch nextToken = peekNextToken(); - for (String[] possibility : possibilities) + for (String possibility : possibilities) if (possibility.equals(nextToken)) throw new InvalidSyntaxException("Not expected \"" + nextToken + "\" here."); } -- 2.20.1 From d179c8161ada24635c95d30ad6033cfc6d6e3d8a Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 17:51:15 +0300 Subject: [PATCH 15/16] Added toString. --- .../svjatoslav/commons/string/tokenizer/Terminator.java | 9 +++++++++ .../commons/string/tokenizer/TokenizerMatch.java | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java index ae51c29..fa07a5b 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Terminator.java @@ -31,4 +31,13 @@ public class Terminator { PRESERVE, DROP } + + @Override + public String toString() { + return "Terminator{" + + "startSequence='" + startSequence + '\'' + + ", endSequence='" + endSequence + '\'' + + ", termination=" + termination + + '}'; + } } diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java index 92997dd..86d7a1b 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/TokenizerMatch.java @@ -18,4 +18,12 @@ public class TokenizerMatch { this.token = token; this.terminator = terminator; } + + @Override + public String toString() { + return "TokenizerMatch{" + + "token='" + token + '\'' + + ", terminator=" + terminator + + '}'; + } } -- 2.20.1 From 4d4a86dce1b84d9ef26d95168f2fea5477cedaa5 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 11 Oct 2017 18:08:09 +0300 Subject: [PATCH 16/16] Fixed lookahead. --- .../commons/string/tokenizer/Tokenizer.java | 4 ++-- .../string/tokenizer/TokenizerTest.java | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/test/java/eu/svjatoslav/commons/string/tokenizer/TokenizerTest.java diff --git a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java index 4855c18..01216d8 100755 --- a/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java +++ b/src/main/java/eu/svjatoslav/commons/string/tokenizer/Tokenizer.java @@ -46,7 +46,7 @@ public class Tokenizer { return this; } - public void expectNextToken(final String value) + public void expectAndConsumeNextToken(final String value) throws InvalidSyntaxException { final TokenizerMatch match = getNextToken(); if (!value.equals(match.token)) @@ -111,7 +111,7 @@ public class Tokenizer { } public boolean peekIsOneOf(String ... possibilities){ - TokenizerMatch nextToken = peekNextToken(); + String nextToken = peekNextToken().token; for (String possibility : possibilities) if (possibility.equals(nextToken)) diff --git a/src/test/java/eu/svjatoslav/commons/string/tokenizer/TokenizerTest.java b/src/test/java/eu/svjatoslav/commons/string/tokenizer/TokenizerTest.java new file mode 100644 index 0000000..e40b401 --- /dev/null +++ b/src/test/java/eu/svjatoslav/commons/string/tokenizer/TokenizerTest.java @@ -0,0 +1,24 @@ +package eu.svjatoslav.commons.string.tokenizer; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class TokenizerTest { + + + @Test + public void peekNextToken() throws Exception { + Tokenizer tokenizer = new Tokenizer("this is a test") + .addTerminator(" ", Terminator.TerminationStrategy.DROP); + + tokenizer.expectAndConsumeNextToken("this"); + + assertEquals("is", tokenizer.peekNextToken().token); + + assertEquals("is", tokenizer.peekNextToken().token); + + assertEquals(true, tokenizer.peekIsOneOf("maybe", "is", "that")); + } + +} \ No newline at end of file -- 2.20.1