Changed license to LGPLv3 or later.
[svjatoslav_commons.git] / src / main / java / eu / svjatoslav / commons / commandline / parameterparser / parameter / NullParameter.java
old mode 100644 (file)
new mode 100755 (executable)
index cadadd1..7e55d57
@@ -1,3 +1,12 @@
+/*
+ * Svjatoslav Commons - shared library of common functionality.
+ * Copyright ©2012-2014, 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
+ * or later as published by the Free Software Foundation.
+ */
+
 package eu.svjatoslav.commons.commandline.parameterparser.parameter;
 
 import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
@@ -6,7 +15,7 @@ import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
 public class NullParameter extends Parameter {
 
        public NullParameter(final String description) {
-               super(null, description, ArgumentCount.SINGLE);
+               super(description, ArgumentCount.NONE);
        }
 
        @Override
@@ -15,6 +24,11 @@ public class NullParameter extends Parameter {
                return this;
        }
 
+       @Override
+       public java.lang.String describeFormat() {
+               return "<none>";
+       }
+
        public boolean getValue() {
                return isParameterSpecified();
        }
@@ -24,4 +38,10 @@ public class NullParameter extends Parameter {
                mandatory = true;
                return this;
        }
+
+       @Override
+       public boolean validate(final java.lang.String value) {
+               return true;
+       }
+
 }