本文整理匯總了Java中org.apache.tools.ant.Project.toBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.toBoolean方法的具體用法?Java Project.toBoolean怎麽用?Java Project.toBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tools.ant.Project
的用法示例。
在下文中一共展示了Project.toBoolean方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: reqManOrMod
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
/** Returns true if either a manifest or a module must be specified.
* This is true unless either the global property
* makenbm.manOrModReq is false, or the manOrModReq attribute of
* this task is false. The attribute, if set, has priority over the
* global property.
*/
public boolean reqManOrMod() {
boolean req = true ;
if( manOrModReqSet) {
req = manOrModReq ;
}
else {
String s = getProject().getProperty("makenbm.manOrModReq"); //NOI18N
if( s != null && !s.equals( "")) { //NOI18N
req = Project.toBoolean(s);
}
}
return( req) ;
}
示例2: getTextNode
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
public org.w3c.dom.Text getTextNode(Document ownerDoc) {
// XXX Current XMLUtil.write anyway does not preserve CDATA sections, it seems.
String nocdata = getProject().getProperty("makenbm.nocdata");
if (nocdata != null && Project.toBoolean(nocdata)) {
return ownerDoc.createTextNode(text.toString());
} else {
return ownerDoc.createCDATASection(text.toString());
}
}
示例3: getText
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
public String getText () {
String nocdata = getProject().getProperty("makenbm.nocdata"); //NOI18N
if (nocdata != null && Project.toBoolean(nocdata)) {
return xmlEscape(text.toString());
} else {
return "<![CDATA[" + text.toString () + "]]>"; //NOI18N
}
}
示例4: specVersBaseWarning
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private void specVersBaseWarning(File manifestFile, String message) throws BuildException {
message = manifestFile + ": " + message + "\n(see http://wiki.netbeans.org/DevFaqImplementationDependency)" +
"\n(define spec.version.base.fatal.warning=false in project.properties to make this be a nonfatal warning)";
if (Project.toBoolean(getProject().getProperty("spec.version.base.fatal.warning"))) {
throw new BuildException(message);
} else {
log(message, Project.MSG_WARN);
}
}
示例5: getLazyJarsSet
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private static Set<? extends File> getLazyJarsSet(final Project prj, final List<? extends File> runCp, final Path value) {
final Set<File> result = new HashSet<File>();
if (value != null) {
for (String pathElement : value.list()) {
result.add(prj.resolveFile(pathElement));
}
}
for (File re : runCp) {
if (Project.toBoolean(prj.getProperty(String.format(JNLP_LAZY_FORMAT, re.getName())))) {
result.add(re);
}
}
return result;
}
示例6: toBoolean
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
public boolean toBoolean(String val) {
return Project.toBoolean(val);
}
示例7: computeClasspathModuleLocation
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private File computeClasspathModuleLocation(ModuleListParser modules, String cnb,
Set<File> clusterPath, Set<String> excludedModules, boolean runtime) throws BuildException {
ModuleListParser.Entry module = modules.findByCodeNameBase(cnb);
if (module == null && cnb.contains("-")) {
final String alternativeCnb = cnb.replace('-', '_');
module = modules.findByCodeNameBase(alternativeCnb);
if (module != null) {
cnb = alternativeCnb;
}
}
if (module == null) {
throw new BuildException("No dependent module " + cnb, getLocation());
}
File jar = module.getJar();
if (jar == null) return null;
OK: if (module.getClusterName() != null && clusterPath != null) {
File clusterF = jar.getParentFile();
while (clusterF != null) {
if (clusterPath.contains(clusterF)) {
break OK;
}
clusterF = clusterF.getParentFile();
}
String msg = "The module " + cnb + " cannot be " + (runtime ? "run" : "compiled") +
" against because it is part of the cluster " +
jar.getParentFile().getParentFile() + " which is not part of cluster.path in your suite configuration.\n\n" +
"Cluster.path is: " + clusterPath;
throw new BuildException(msg, getLocation());
}
if (excludedModules != null && excludedModules.contains(cnb)) { // again #68716
throw new BuildException("Module " + cnb + " excluded from the target platform", getLocation());
}
if (!jar.isFile()) {
File srcdir = module.getSourceLocation();
if (Project.toBoolean(getProject().getProperty(DO_NOT_RECURSE))) {
log(jar + " missing for " + moduleProject + " but will not first try to build " + srcdir, Project.MSG_VERBOSE);
return jar;
}
if (srcdir != null && srcdir.isDirectory()) {
log(jar + " missing for " + moduleProject + "; will first try to build " + srcdir, Project.MSG_WARN);
Ant ant = new Ant();
ant.setProject(getProject());
ant.setOwningTarget(getOwningTarget());
ant.setLocation(getLocation());
ant.setInheritAll(false);
ant.setDir(srcdir);
ant.execute();
}
}
if (!jar.isFile()) {
throw new BuildException("No such classpath entry: " + jar, getLocation());
}
return jar;
}