Skip to content

Commit

Permalink
Remove wild card imports and add single imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiyanwso2 committed Sep 2, 2024
1 parent 6cbc7e7 commit 82afa10
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@
import java.util.ArrayList;
import java.util.List;

import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.*;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.CDS_SERVICES;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.CONFIG;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.DEPENDENCIES;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.DEPENDENT_PACKAGE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.HOOKS;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.PACKAGE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.PROJECT_PACKAGE_DEPENDENT_PACKAGE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.PROJECT_PACKAGE_NAME_PREFIX;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.PROJECT_PACKAGE_ORG;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.PROJECT_PACKAGE_VERSION;


/**
* Main config class to hold all the config objects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@

import com.google.gson.JsonObject;

import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.*;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.NAME;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.ORG;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.VERSION;


public class DependencyConfig {
private final String org;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@
import java.util.ArrayList;
import java.util.List;

import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.*;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.AUTHORS;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.DISTRIBUTION;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.KEYWORDS;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.NAME_PREFIX;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.ONE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.ORG;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.REGEX_STRING_FOR_NON_WORD_CHARACTER;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.UNDERSCORE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.VERSION;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.ZERO;


public class MetadataConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.*;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.CMD_MESSAGE_OVERRIDE_OUTPUT_DIRECTORY;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.CONFIG;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.NO;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.ONE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.REGEX_STRING_FOR_NON_WORD_CHARACTER;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.REGEX_STRING_FOR_UNDERSCORE_AND_HYPHEN;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.SERVICE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.UNDERSCORE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.YES;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.ZERO;


/**
* Generator class to wrap all the generator classes in Ballerina project generator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@

import java.util.Map;

import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.*;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_GIT_IGNORE_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_GIT_IGNORE_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_PACKAGE_MD_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_PACKAGE_MD_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.CONFIG;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.META_CONFIG;


public class MetaGenerator extends AbstractFHIRTemplateGenerator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@

import java.util.Map;

import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.*;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_DECISION_SYSTEM_CONNECTION_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_DECISION_SYSTEM_CONNECTION_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_FEEDBACK_SYSTEM_CONNECTION_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_FEEDBACK_SYSTEM_CONNECTION_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_INTERCEPTOR_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_INTERCEPTOR_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_SERVICE_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_SERVICE_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_UTILS_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_UTILS_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.SERVICE;


/**
* Generator for Ballerina service files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@
import java.util.ArrayList;
import java.util.Map;

import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.*;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_CONFIG_TOML_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_CONFIG_TOML_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_TOML_FILE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.BAL_TOML_VM;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.CONFIG;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.KEYWORDS;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.META_CONFIG;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.SERVICE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.TEMPLATE_NAME;


/**
* Generator for Ballerina.Toml file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@
import java.util.HashMap;
import java.util.Map;

import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.*;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.DESCRIPTION;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.HOOK;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.ID;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.PREFETCH;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.TITLE;
import static org.wso2.healthcare.cds.codegen.ballerina.tool.CdsBallerinaProjectConstants.USAGE_REQUIREMENTS;


public class CdsHook {
String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
import io.ballerina.health.cmd.hl7.Hl7SubCmd;
import picocli.CommandLine;

import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
import io.ballerina.health.cmd.handler.HandlerFactory;
import picocli.CommandLine;

import java.io.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -36,7 +41,29 @@
import java.util.Map;
import java.util.logging.LogManager;

import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.*;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CDS;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CDS_SUB_TOOL_DESCRIPTION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_MODE_TEMPLATE;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_CDS_MODE_DESCRIPTION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_CUSTOM_ARGS_DESCRIPTION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_HELP;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_HELP_SHORTER_1;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_HELP_SHORTER_2;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_INPUT;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_INPUT_SHORTER;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_MODE;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_MODE_SHORTER;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_ORG_NAME;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_ORG_NAME_DESCRIPTION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_OUTPUT;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_OUTPUT_DESCRIPTION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_OUTPUT_SHORTER;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_PACKAGE_NAME;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_PACKAGE_NAME_DESCRIPTION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_PACKAGE_VERSION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_PACKAGE_VERSION_DESCRIPTION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.USER_DIR;


@CommandLine.Command(name = CDS, description = CDS_SUB_TOOL_DESCRIPTION)
public class CdsSubCmd implements BLauncherCmd {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import io.ballerina.health.cmd.core.exception.BallerinaHealthException;
import net.consensys.cava.toml.Toml;
import net.consensys.cava.toml.TomlParseResult;
import org.apache.commons.lang.StringUtils;

import java.io.*;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Path;

import static io.ballerina.health.cmd.core.utils.HealthCmdUtils.tomlToJson;

public class HealthCmdConfig {

public static JsonObject getParsedConfigFromPath(Path toolConfigPath) throws BallerinaHealthException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,18 @@
import java.util.Map;
import java.util.Set;

import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.*;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CDS;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CDS_CONFIG_CLASS_NAME;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CDS_TOOL_CLASS_NAME;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_CDS_JSON_SCHEMA_FILENAME;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_ORG_NAME;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_PACKAGE_NAME;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_PACKAGE_VERSION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.HOOKS;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.PROJECT_PACKAGE_NAME_PREFIX;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.PROJECT_PACKAGE_ORG;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.PROJECT_PACKAGE_VERSION;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.TOOLS;
import static io.ballerina.health.cmd.core.utils.HealthCmdUtils.exitError;
import static io.ballerina.health.cmd.core.utils.HealthCmdUtils.parseTomlToJson;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@

import java.io.PrintStream;

import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.*;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_CDS_MODE_TEMPLATE;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_FHIR_MODE_CLIENT;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_FHIR_MODE_PACKAGE;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_FHIR_MODE_TEMPLATE;
import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.SEMICOLON;

/**
* Factory class to create handlers.
Expand Down

0 comments on commit 82afa10

Please sign in to comment.