📄 abstractjavacompiler.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.//// $Id: AbstractJavaCompiler.java,v 1.2.2.1 2004/01/11 20:42:34 per_nyfelt Exp $package org.ozoneDB.tools.OPP.compiler;import java.io.File;import java.util.Collection;import java.util.List;import java.util.ArrayList;import java.util.Iterator;/** * Abstract configuration interface for JDK build compilers. * * Date: 2003-sep-21 * Time: 15:04:09 */public abstract class AbstractJavaCompiler implements JavaCompiler { private String classpath; private boolean optimize; private boolean debug; private boolean noWarn; private boolean deprecation; private File sourcePath; private File outputPath; public File getOutputPath() { return outputPath; } public void setOutputPath(File outputPath) { this.outputPath = outputPath; } public boolean isOptimize() { return optimize; } public void setOptimize(boolean optimize) { this.optimize = optimize; } public boolean isDebug() { return debug; } public void setDebug(boolean debug) { this.debug = debug; } public boolean isNoWarn() { return noWarn; } public void setNoWarn(boolean noWarn) { this.noWarn = noWarn; } public boolean isDeprecation() { return deprecation; } public void setDeprecation(boolean deprecation) { this.deprecation = deprecation; } public File getSourcePath() { return sourcePath; } public void setSourcePath(File sourcePath) { this.sourcePath = sourcePath; } public String getClasspath() { return classpath; } public void setClasspath(String classpath) { this.classpath = classpath; } protected String[] getArguments(Collection classes) { return getArguments(null, classes); } /** * Returns command line arguments from the compiler settings. * @param command Compiler command, skipped if null. * @param classes The number classes to compile * @return The array of a arguments */ protected String[] getArguments(String command, Collection classes) { List arguments = new ArrayList(classes.size() + 10); if (command != null) { arguments.add(command); } if (classpath != null) { arguments.add("-classpath"); arguments.add(getClasspath()); } if (optimize) { arguments.add("-O"); } if (debug) { arguments.add("-g"); } else { arguments.add("-g:none"); } if (noWarn) { arguments.add("-noWarn"); } if (deprecation) { arguments.add("-deprecation"); } if (sourcePath != null) { arguments.add("-sourcepath"); arguments.add(sourcePath.toString()); //arguments.add(sourcePath.getAbsolutePath()); } if (outputPath != null) { arguments.add("-d"); arguments.add(outputPath.toString()); //arguments.add(outputPath.getAbsolutePath()); } arguments.addAll(classes); String retArgs[] = new String[arguments.size()]; int i = 0; for (Iterator iter = arguments.iterator(); iter.hasNext(); i++) { retArgs[i] = (String) iter.next(); //System.out.println(retArgs[i]); } return retArgs; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -