diff --git a/.gitignore b/.gitignore index 38ef286..e7f46e3 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,11 @@ #Other /releases/ +/packages/ +/oqlmodule.mpr.bak +/oqlmodule.mpr.lock +/modeler-merge-marker +/nativemobile/builds/ +/vendorlib/temp/ +.DS_Store +/.svn/ diff --git a/OQLModule.mpr b/OQLModule.mpr index 0bae99f..44a66d1 100644 Binary files a/OQLModule.mpr and b/OQLModule.mpr differ diff --git a/javasource/oql/actions/CountLines.java b/javasource/oql/actions/CountLines.java new file mode 100644 index 0000000..84f8657 --- /dev/null +++ b/javasource/oql/actions/CountLines.java @@ -0,0 +1,53 @@ +// This file was generated by Mendix Studio Pro. +// +// WARNING: Only the following code will be retained when actions are regenerated: +// - the import list +// - the code between BEGIN USER CODE and END USER CODE +// - the code between BEGIN EXTRA CODE and END EXTRA CODE +// Other code you write will be lost the next time you deploy the project. +// Special characters, e.g., é, ö, à, etc. are supported in comments. + +package oql.actions; + +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.systemwideinterfaces.core.UserAction; + +public class CountLines extends UserAction +{ + private final java.lang.String InputString; + + public CountLines( + IContext context, + java.lang.String _inputString + ) + { + super(context); + this.InputString = _inputString; + } + + @java.lang.Override + public java.lang.Long executeAction() throws Exception + { + // BEGIN USER CODE + if (InputString == null) { + return 0L; + } + return InputString.lines() + .filter(line -> !line.trim().isEmpty()) + .count(); + // END USER CODE + } + + /** + * Returns a string representation of this action + * @return a string representation of this action + */ + @java.lang.Override + public java.lang.String toString() + { + return "CountLines"; + } + + // BEGIN EXTRA CODE + // END EXTRA CODE +}