Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Map;

public class Main {

    private static String parseConstant(String condition, Map<String, String> mpUser) {
        if (condition == null || condition.length() == 0)
            return "";
        if (mpUser == null || mpUser.isEmpty())
            return condition;

        condition = condition.replaceAll("{CURUSERID}", mpUser.get("user_id"));

        condition = condition.replaceAll("{CURUSERCODE}", mpUser.get("user_code"));

        condition = condition.replaceAll("{CURUSERNAME}", mpUser.get("user_name"));

        condition = condition.replaceAll("{CURDEPTID}", mpUser.get("dept_id"));

        condition = condition.replaceAll("{CURDEPTCODE}", mpUser.get("dept_code"));

        condition = condition.replaceAll("{CURDEPTNAME}", mpUser.get("dept_name"));

        return condition;
    }
}