JQuickLang Syntax Reference

May 3, 2026 · View on GitHub

Overview

JQuick Java is a lightweight Java-like scripting language, inherently designed for rule engines。 it perfectly integrates the strong type safety of Java with the dynamic flexibility of JavaScript, supporting dynamic loading, parsing, and execution of business rules at runtime ,whether it's complex logical judgments or data verification or process orchestration,jQuick Java enables you to tune business rules as if they were configuration parameters, no need to restart the application or redeploy, allowing your system to truly achieveseparation of rules and code.

Table of Contents

Core Features

1. Simplified Type System

  • 7 Primitive types built-in
  • Full generics support
  • Flexible collections (List/Set/Map)
  • dimensional arrays
// Primitive types
int counter = 0;
boolean enabled = true;

// Generic collections
List<String> names = ["Alice", "Bob"];
Map<String, Integer> scores = {"Math":90, "English":85};

Program Structure

import com.example.pkg as pkgAlias;
int x = 10;
console.log(x);

Import Declarations

ComponentDescription
qualified.namedot-separated path (e.g., java.lang.String)
asalias name

Variable Declarations

KeywordExampleDescription
simpleTypeint x = 10;Type inferred
TypeNameString s = "hi";Explicit type (optional)

Data Types

Primitive Types (simpleType)

Type KeywordData TypeExample
shortShort integershort s = 100;
intIntegerint x = 42;
floatFloating pointfloat pi = 3.14;
doubleDoubledouble d = 9.99;
longLong integerlong big = 100;
booleanBooleanboolean flag = true;
byteBytebyte b = 0x1F;
Nullnullnull
DateDate2025-06-07
DateDate2025-06-07 12:00:01

Composite Types

Type FormatExample
Generic (Type)List<String> names;
Generic Multi (Type<K,V>)Map<String, Integer> scores;
ListList<Double> prices;
SetSet<Employee> staff;
Arrayint[] numbers = {1,2,3};
Custom ClassMyClass obj = new MyClass();
Import Aliasimport java.util.Date as JDate;
import List<java.lang.String> as StringList ;
StringList list=["A","B","C"];

Expressions

Operator GroupOperatorsExampleDesc
Mul*1*1number * number
Div/1/1number / number
Add+1+1number + number string+string
Sub-1-1number - number
GT>1>1number > number
GE>=1>=1number * number
LT<1<1number < number
LE<=1<=1number <= number
NE!=1 !=1number != number
EQ==1==1number == number
AND&&true&& trueboolean && boolean
OR||true || falseboolean|| boolean
PAREN(expression)(a + b) * 2 > 10 && x != yboolean|| boolean

sample code

(a + b) * 2 > 10 && x != y

Control Structures

if statement

 if(false){
            console.log(1);
        }else if(true){
            console.log(2);
        }else if(false){
            console.log(3);
        }else{
            console.log(4);
        }

loop statement

        for (int i = 0; i < 10; i = i + 1) {
            for (int j = 0; j < 10; j = j + 1){
                if(j==2){
                    continue;
                }else{
                    console.log(i+","+j);                }
            }
        };
 while(true){
            for (int a = 0; a<10; a=a+1){
                if(a==2){
                    continue;
                }else{
                    console.log("当前的变量a:"+a);
                }
            }
            break;
        }

method definition

int def funtionName(int:a, int:b) {
    return a + b;
}
import List<java.lang.String> as StringList ;
StringList def funtionName(StringList:a, int:b) {
    return a;
}

invocation Styles

TypeExample
Static MethodMath::max(1, 2)
Constructornew ArrayList()
Instance Methodlist.add("item")
This-contextthis.doSomething()

Static Method

  1. sample
java.lang.Math::max(int:5, int:10);
output:10
  1. sample
java.lang.Math::pow(double:2, double:3);
output:8.0
  1. sample
java.lang.String::valueOf(int:123);
output:123
  1. sample
java.util.Objects::toString(java.lang.String:null);
output:null
  1. sample
java.lang.String::format(java.lang.String:"Number: %d, String: %s",int: 42, java.lang.String:"test");
output:Number: 42, String: test
  1. sample
java.lang.System::currentTimeMillis();
output:1754713207541
  1. sample
java.lang.String::join(java.lang.CharSequence:",", java.lang.CharSequence:"a",java.lang.CharSequence: "b", java.lang.CharSequence:"c");
output:a,b,c
  1. sample
com.github.paohaijiao.service.JService::sum(int:1,int:2);
   output:3

Constructor Method

  1. sample
new com.github.paohaijiao.service.JService();
  1. sample
new com.github.paohaijiao.model.JStudent(int:42, float:3.14, boolean:true);
  1. sample
new com.github.paohaijiao.model.JStudent(java.lang.String:"test string");
  1. sample
new com.github.paohaijiao.model.JStudent(List<java.lang.Integer>:listVar);
  1. sample
new com.github.paohaijiao.model.JStudent(java.lang.String:"test", java.lang.Integer:123, java.lang.Boolean:true, List<java.lang.Integer>:listVar);
  1. sample
new java.util.ArrayList();
  1. sample
new com.github.paohaijiao.model.JStudent(java.lang.String:"a", java.lang.String:"b", java.lang.String:"c");

Instance Method

  1. sample
testObj.isEven(int:4);
output: true
  1. sample
testObj.noReturn();
  1. sample
testObj.addToList(java.util.ArrayList<java.lang.Integer>:listVar, java.lang.Integer:4);
  1. sample
testObj.methodWithMixedArgs(java.lang.String:"Test", int:42, boolean:true);
  1. sample
testObj.methodWithVarArgs(java.lang.String:"a", java.lang.String:"b", java.lang.String:"c");

output

console.log("Result: " + result);

Comments

// single-line
/*
  multi-line
*/

code sample

java.lang.String def a(int:a,float:b) {
    java.lang.String p=java.lang.String::format(java.lang.String:"Number: %d, String: %s",int: 42, java.lang.String:"test"); 
    return p;    
}
    int c=1;
    float d=8.1;
    this.a(int:c,float:d);
java.util.HashMap<java.lang.String,java.lang.String> def a(int:a,float:b) {
    java.lang.String str1 = new java.lang.String(java.lang.String:"Hello");
    console.log(str1); 
    java.lang.String upperStr = str1.toUpperCase(); 
    console.log(upperStr);  
    java.lang.String subStr = str1.substring(int:1, int:3);
    console.log(subStr);  
    java.util.HashMap<java.lang.String,java.lang.String> result = new java.util.HashMap();
    result.put(java.lang.String:"constructed1", java.lang.String:str1);  
    result.put(java.lang.String:"constructed2", java.lang.String:str1); 
    result.put(java.lang.String:"uppercased", java.lang.String:upperStr); 
    result.put(java.lang.String:"substring", java.lang.String:subStr); 
    return result;    
 }
    int c=1;
    float d=8.1;
    this.a(int:c,float:d);

appendix

global, 
short, 
int, 
float, 
double, 
long, 
boolean, 
byte, 
new, 
var, 
return, 
function, 
null, 
this, 
import, 
continue, 
break, 
as, 
if, 
else, 
for, 
while,
true, 
false, 
null

Identifier Rules

1.starts with letter/underscore
2.may contain letters, digits, underscores
3.case-sensitive

complete example

  1. sample 1
int def getSquare(int:a,int:b){
    return a*b;
}
int a=1;
int b=2;
int c=this.getSquare(int:a,int:b);
  1. sample 2
java.util.HashMap<java.lang.String,java.lang.String>   def a(int:a,float:b) {
    java.lang.String str1 = new java.lang.String(java.lang.String:"Hello");
    console.log(str1);
    java.lang.String upperStr = str1.toUpperCase();
    console.log(upperStr);  
    java.lang.String subStr = str1.substring(int:1, int:3);
    console.log(subStr);  
    java.util.HashMap<java.lang.String,java.lang.String> result = new java.util.HashMap();  result.put(java.lang.String:"constructed1", java.lang.String:str1);  result.put(java.lang.String:"constructed2", java.lang.String:str1);
    result.put(java.lang.String:"uppercased", java.lang.String:upperStr);  result.put(java.lang.String:"substring", java.lang.String:subStr);
    return result;    
}
int c=1;
float d=8.1;
this.a(int:c,float:d);
  1. sample 3
java.lang.String def a(int:a,float:b) {
        java.lang.String p=java.lang.String::format(java.lang.String:"Number: %d, String: %s",int: 42, java.lang.String:"test"); 
        return p;   
}
   int c=1;
   float d=8.1;
   this.a(int:c,float:d);
  1. sample 4
import java.lang.String as type1; 
type1 def a(int:a,float:b) {
   type1 p=type1::format(type1:"Number: %d, String: %s",int: 42, type1:"test");
    return p;    
}
   int c=1;
   float d=8.1;
   this.a(int:c,float:d);

Generating Power with Love (and Caffeine) ☕

Thank you for using this open-source project! It is completely free and will be maintained continuously, but the developers do need your support.


How You Can Help

  1. Buy Me a Coffee
    If this project has saved you time or money, please consider supporting me with a small donation.

  2. Where Your Donation Goes

  • Server costs to keep the project running.
  • Feature development to add more value.
  • Documentation optimization for a better user experience.
  1. Every Cent Counts
    Even a donation of just 1 cent motivates me to debug late into the night!

Why Donate?

✔️ Keep the project free and ad-free forever.
✔️ Support timely responses to issues and community inquiries.
✔️ Enable planned features for the future.

Thank you for being a partner in making the open-source world better!


Additional Notes

  • The project is maintained with love and caffeine.
  • Your support ensures its sustainability and growth.

🌟 Support Now

Feel free to leave a message via email when sponsoring. Your name will be included in the "Special Thanks" list in the project's README file! OCBC Pay Now Touch n Go