本文整理汇总了Java中com.intellij.execution.configurations.ParametersList.hasParameter方法的典型用法代码示例。如果您正苦于以下问题:Java ParametersList.hasParameter方法的具体用法?Java ParametersList.hasParameter怎么用?Java ParametersList.hasParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.configurations.ParametersList
的用法示例。
在下文中一共展示了ParametersList.hasParameter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateJavaParameters
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@Override
public <T extends RunConfigurationBase> void updateJavaParameters(
final T configuration, final JavaParameters params, final RunnerSettings runnerSettings
) throws ExecutionException {
if (runnerSettings != null || !isApplicableFor(configuration)) {
return;
}
final Project project = configuration.getProject();
final ParametersList vmParameters = params.getVMParametersList();
if (!vmParameters.hasParameter("-ea")) {
vmParameters.add("-ea");
}
if (vmParameters.getParameters().stream().noneMatch(param -> param.startsWith("-Dplatformhome="))) {
final VirtualFile platformRootDirectory = findPlatformRootDirectory(project);
if (platformRootDirectory != null) {
vmParameters.add("-Dplatformhome=" + platformRootDirectory.getPath());
}
}
if (!params.getEnv().containsKey(HYBRIS_DATA_DIR_ENV)) {
final HybrisProjectSettings settings = HybrisProjectSettingsComponent.getInstance(project).getState();
final String hybrisDataDirPath = FileUtil.toCanonicalPath(
project.getBasePath() + '/' + settings.getHybrisDirectory() + '/' + HybrisConstants.HYBRIS_DATA_DIRECTORY);
if (hybrisDataDirPath != null) {
params.addEnv(HYBRIS_DATA_DIR_ENV, hybrisDataDirPath);
}
}
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:32,代码来源:HybrisJUnitExtension.java
示例2: appendParamsEncodingClasspath
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static void appendParamsEncodingClasspath(SimpleJavaParameters javaParameters,
GeneralCommandLine commandLine,
ParametersList parametersList) {
commandLine.addParameters(parametersList.getList());
appendEncoding(javaParameters, commandLine, parametersList);
if (!parametersList.hasParameter("-classpath") && !parametersList.hasParameter("-cp") && !javaParameters.getClassPath().getPathList().isEmpty()){
commandLine.addParameter("-classpath");
commandLine.addParameter(javaParameters.getClassPath().getPathsString());
}
}
示例3: appendParamsEncodingClasspath
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static void appendParamsEncodingClasspath(SimpleJavaParameters javaParameters,
GeneralCommandLine commandLine,
ParametersList parametersList) {
commandLine.addParameters(parametersList.getList());
appendEncoding(javaParameters, commandLine, parametersList);
if (!parametersList.hasParameter("-classpath") && !parametersList.hasParameter("-cp")){
commandLine.addParameter("-classpath");
commandLine.addParameter(javaParameters.getClassPath().getPathsString());
}
}
示例4: setupJVMCommandLine
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
public static GeneralCommandLine setupJVMCommandLine(final String exePath,
final SimpleJavaParameters javaParameters,
final boolean forceDynamicClasspath) {
final GeneralCommandLine commandLine = new GeneralCommandLine(exePath);
final ParametersList vmParametersList = javaParameters.getVMParametersList();
commandLine.withEnvironment(javaParameters.getEnv());
commandLine.withParentEnvironmentType(javaParameters.isPassParentEnvs() ? ParentEnvironmentType.CONSOLE : ParentEnvironmentType.NONE);
final Class commandLineWrapper;
if ((commandLineWrapper = getCommandLineWrapperClass()) != null) {
if (forceDynamicClasspath && !vmParametersList.hasParameter("-classpath") && !vmParametersList.hasParameter("-cp")) {
if (isClassPathJarEnabled(javaParameters, PathUtil.getJarPathForClass(ClassPath.class))) {
appendJarClasspathParams(javaParameters, commandLine, vmParametersList, commandLineWrapper);
}
else {
appendOldCommandLineWrapper(javaParameters, commandLine, vmParametersList, commandLineWrapper);
}
}
else {
appendParamsEncodingClasspath(javaParameters, commandLine, vmParametersList);
}
}
else {
appendParamsEncodingClasspath(javaParameters, commandLine, vmParametersList);
}
final String mainClass = javaParameters.getMainClass();
final String jarPath = javaParameters.getJarPath();
if (mainClass != null) {
commandLine.addParameter(mainClass);
}
else if (jarPath != null) {
commandLine.addParameter("-jar");
commandLine.addParameter(jarPath);
}
commandLine.addParameters(javaParameters.getProgramParametersList().getList());
commandLine.withWorkDirectory(javaParameters.getWorkingDirectory());
return commandLine;
}
示例5: appendJarClasspathParams
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static void appendJarClasspathParams(SimpleJavaParameters javaParameters,
GeneralCommandLine commandLine,
ParametersList vmParametersList, Class commandLineWrapper) {
try {
final Manifest manifest = new Manifest();
manifest.getMainAttributes().putValue("Created-By",
ApplicationNamesInfo.getInstance().getFullProductName());
final boolean writeDynamicVMOptions = javaParameters.isDynamicVMOptions() && useDynamicVMOptions();
if (writeDynamicVMOptions) {
List<String> dParams = new ArrayList<String>();
for (String param : vmParametersList.getList()) {
if (param.startsWith("-D")) {
dParams.add(param);
}
}
manifest.getMainAttributes().putValue("VM-Options", ParametersListUtil.join(dParams));
final ArrayList<String> restParams = new ArrayList<String>(vmParametersList.getList());
restParams.removeAll(dParams);
commandLine.addParameters(restParams);
}
else {
commandLine.addParameters(vmParametersList.getList());
}
final boolean notEscape = vmParametersList.hasParameter(PROPERTY_DO_NOT_ESCAPE_CLASSPATH_URL);
final List<String> classPathList = javaParameters.getClassPath().getPathList();
final String jarFile = CommandLineWrapperUtil.createClasspathJarFile(manifest, classPathList, notEscape).getAbsolutePath();
commandLine.addParameter("-classpath");
if (writeDynamicVMOptions) {
commandLine.addParameter(PathUtil.getJarPathForClass(commandLineWrapper) + File.pathSeparator + jarFile);
appendEncoding(javaParameters, commandLine, vmParametersList);
commandLine.addParameter(commandLineWrapper.getName());
commandLine.addParameter(jarFile);
}
else {
commandLine.addParameters(jarFile);
appendEncoding(javaParameters, commandLine, vmParametersList);
}
}
catch (IOException e) {
LOG.error(e);
}
}
示例6: explicitClassPath
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static boolean explicitClassPath(ParametersList vmParameters)
{
return vmParameters.hasParameter("-cp") || vmParameters.hasParameter("-classpath") || vmParameters.hasParameter("--class-path");
}
示例7: explicitModulePath
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static boolean explicitModulePath(ParametersList vmParameters)
{
return vmParameters.hasParameter("-p") || vmParameters.hasParameter("--module-path");
}
示例8: setClasspathJarParams
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static void setClasspathJarParams(GeneralCommandLine commandLine,
OwnSimpleJavaParameters javaParameters,
ParametersList vmParameters,
Class commandLineWrapper,
boolean dynamicVMOptions,
boolean dynamicParameters) throws CantRunException
{
try
{
Manifest manifest = new Manifest();
manifest.getMainAttributes().putValue("Created-By", ApplicationNamesInfo.getInstance().getFullProductName());
String manifestText = "";
if(dynamicVMOptions)
{
List<String> properties = new ArrayList<>();
for(String param : vmParameters.getList())
{
if(isUserDefinedProperty(param))
{
properties.add(param);
}
else
{
commandLine.addParameter(param);
}
}
manifest.getMainAttributes().putValue("VM-Options", ParametersListUtil.join(properties));
manifestText += "VM-Options: " + ParametersListUtil.join(properties) + "\n";
}
else
{
commandLine.addParameters(vmParameters.getList());
}
appendEncoding(javaParameters, commandLine, vmParameters);
if(dynamicParameters)
{
manifest.getMainAttributes().putValue("Program-Parameters", ParametersListUtil.join(javaParameters.getProgramParametersList().getList()));
manifestText += "Program-Parameters: " + ParametersListUtil.join(javaParameters.getProgramParametersList().getList()) + "\n";
}
boolean notEscape = vmParameters.hasParameter(PROPERTY_DO_NOT_ESCAPE_CLASSPATH_URL);
PathsList path = javaParameters.getClassPath();
File classpathJarFile = CommandLineWrapperUtil.createClasspathJarFile(manifest, path.getPathList(), notEscape);
String jarFilePath = classpathJarFile.getAbsolutePath();
commandLine.addParameter("-classpath");
if(dynamicVMOptions || dynamicParameters)
{
commandLine.addParameter(PathUtil.getJarPathForClass(commandLineWrapper) + File.pathSeparator + jarFilePath);
commandLine.addParameter(commandLineWrapper.getName());
}
commandLine.addParameter(jarFilePath);
commandLine.putUserData(COMMAND_LINE_CONTENT, ContainerUtil.stringMap(jarFilePath, manifestText + "Class-Path: " + path.getPathsString()));
OSProcessHandler.deleteFileOnTermination(commandLine, classpathJarFile);
}
catch(IOException e)
{
throwUnableToCreateTempFile(e);
}
}