Browse Source

Add javadoc to CommandLineJava for source-file execution APIs

master
Jaikiran Pai 7 years ago
parent
commit
4ce54bf3b6
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      src/main/org/apache/tools/ant/types/CommandlineJava.java

+ 13
- 0
src/main/org/apache/tools/ant/types/CommandlineJava.java View File

@@ -368,11 +368,24 @@ public class CommandlineJava implements Cloneable {
return null;
}

/**
* Set the source-file, to execute as single file source programs, a feature, available
* since Java 11.
*
* @param sourceFile The path to the source file
* @since Ant 1.10.5
*/
public void setSourceFile(final String sourceFile) {
this.executableType = ExecutableType.SOURCE_FILE;
javaCommand.setExecutable(sourceFile);
}

/**
* @return Returns the source-file to execute, if this command line has
* been {@link #setSourceFile(String) configured for single file source program
* execution}. Else returns null.
* @since Ant 1.10.5
*/
public String getSourceFile() {
return this.executableType == ExecutableType.SOURCE_FILE ? this.javaCommand.getExecutable() : null;
}


Loading…
Cancel
Save