当前位置: 首页>>代码示例>>Java>>正文


Java PropertySet类代码示例

本文整理汇总了Java中org.apache.tools.ant.types.PropertySet的典型用法代码示例。如果您正苦于以下问题:Java PropertySet类的具体用法?Java PropertySet怎么用?Java PropertySet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertySet类属于org.apache.tools.ant.types包,在下文中一共展示了PropertySet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addPropertyset

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
/**
 * Set of properties to pass to the new project.
 * @param ps the <code>PropertySet</code> to pass.
 * @since Ant 1.6
 */
public void addPropertyset(PropertySet ps) {
    if (callee == null) {
        init();
    }
    callee.addPropertyset(ps);
}
 
开发者ID:apache,项目名称:ant,代码行数:12,代码来源:CallTarget.java

示例2: add

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
/**
 * Restrict the expanded properties using a PropertySet.
 * @param propertySet replacement lookup
 */
public void add(PropertySet propertySet) {
    if (this.propertySet != null) {
        throw new BuildException("expandproperties filter accepts only one propertyset");
    }
    this.propertySet = propertySet;
}
 
开发者ID:apache,项目名称:ant,代码行数:11,代码来源:ExpandProperties.java

示例3: addConfiguredPropertyset

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
public void addConfiguredPropertyset(PropertySet ps) {
  propertysets.add(ps);

  // Copy the contents of the propertyset into the argument-list.
  for (Iterator<?> prop=ps.iterator(); prop.hasNext(); ) {
    PropertyResource res = (PropertyResource)prop.next();
    args.add(new Arg(res.getName(), res.getValue()));
  }

}
 
开发者ID:ibm-datapower,项目名称:datapower-configuration-manager,代码行数:11,代码来源:taskDpupload.java

示例4: testSerialRun_SingleModule_WithPropertySets_AndInheritedPropertiesByDefault

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
public void testSerialRun_SingleModule_WithPropertySets_AndInheritedPropertiesByDefault()
{
    final ModuleInfo moduleInfo = new ModuleInfo("foo/", moduleLoader);
    moduleInfo.addAttribute("1", "2");
    moduleLoader.modules.put("foo/", moduleInfo);
    
    final MockCallTargetTask task1 = new MockCallTargetTask(project);
    project.tasks.add(task1);
    
    task.init();
    task.setTarget("testTarget");
    task.setModuleRefId("moduleRef");
    task.createModule().setPath("foo");
    task.addConfigured(moduleLoader);
    
    final PropertySet propSet1 = new PropertySet();
    propSet1.setProject(project);
    propSet1.appendName("123");
    propSet1.appendName("hello");
    propSet1.appendName("no_such_property");
    final PropertySet propSet2 = new PropertySet();
    propSet2.setProject(project);
    propSet2.appendName("qwerty");
    task.addPropertyset(propSet1);
    task.addPropertyset(propSet2);
    
    project.setProperty("123", "456");
    project.setProperty("12345", "45678");
    project.setProperty("hello", "universe");
    project.setProperty("qwerty", "board");
    
    task.perform();
    
    TestUtil.assertCallTargetState(task1, true, "testTarget", true, false, "moduleRef", moduleInfo,
            TestUtil.<String, Object>map("123", "456", "12345", "45678", "hello", "universe", "qwerty", "board"));
}
 
开发者ID:dzidzitop,项目名称:ant_modular,代码行数:37,代码来源:CallTargetForModules_SerialUseTest.java

示例5: testSerialRun_SingleModule_WithPropertySets_AndInheritedPropertiesForced

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
public void testSerialRun_SingleModule_WithPropertySets_AndInheritedPropertiesForced()
{
    final ModuleInfo moduleInfo = new ModuleInfo("foo/", moduleLoader);
    moduleInfo.addAttribute("1", "2");
    moduleLoader.modules.put("foo/", moduleInfo);
    
    final MockCallTargetTask task1 = new MockCallTargetTask(project);
    project.tasks.add(task1);
    
    task.init();
    task.setTarget("testTarget");
    task.setModuleRefId("moduleRef");
    task.createModule().setPath("foo");
    task.addConfigured(moduleLoader);
    task.setInheritAll(true);
    
    final PropertySet propSet1 = new PropertySet();
    propSet1.setProject(project);
    propSet1.appendName("123");
    propSet1.appendName("hello");
    propSet1.appendName("no_such_property");
    final PropertySet propSet2 = new PropertySet();
    propSet2.setProject(project);
    propSet2.appendName("qwerty");
    task.addPropertyset(propSet1);
    task.addPropertyset(propSet2);
    
    project.setProperty("123", "456");
    project.setProperty("12345", "45678");
    project.setProperty("hello", "universe");
    project.setProperty("qwerty", "board");
    
    task.perform();
    
    TestUtil.assertCallTargetState(task1, true, "testTarget", true, false, "moduleRef", moduleInfo,
            TestUtil.<String, Object>map("123", "456", "12345", "45678", "hello", "universe", "qwerty", "board"));
}
 
开发者ID:dzidzitop,项目名称:ant_modular,代码行数:38,代码来源:CallTargetForModules_SerialUseTest.java

示例6: testSerialRun_SingleModule_WithPropertySets_PropertiesNotInherited

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
public void testSerialRun_SingleModule_WithPropertySets_PropertiesNotInherited()
{
    final ModuleInfo moduleInfo = new ModuleInfo("foo/", moduleLoader);
    moduleInfo.addAttribute("1", "2");
    moduleLoader.modules.put("foo/", moduleInfo);
    
    final MockCallTargetTask task1 = new MockCallTargetTask(project);
    project.tasks.add(task1);
    
    task.init();
    task.setTarget("testTarget");
    task.setModuleRefId("moduleRef");
    task.createModule().setPath("foo");
    task.addConfigured(moduleLoader);
    task.setInheritAll(false);
    
    final PropertySet propSet1 = new PropertySet();
    propSet1.setProject(project);
    propSet1.appendName("123");
    propSet1.appendName("hello");
    propSet1.appendName("no_such_property");
    final PropertySet propSet2 = new PropertySet();
    propSet2.setProject(project);
    propSet2.appendName("qwerty");
    task.addPropertyset(propSet1);
    task.addPropertyset(propSet2);
    
    project.setProperty("123", "456");
    project.setProperty("12345", "45678");
    project.setProperty("hello", "universe");
    project.setProperty("qwerty", "board");
    
    task.perform();
    
    TestUtil.assertCallTargetState(task1, true, "testTarget", false, false, "moduleRef", moduleInfo,
            TestUtil.<String, Object>map("123", "456", "hello", "universe", "qwerty", "board"));
}
 
开发者ID:dzidzitop,项目名称:ant_modular,代码行数:38,代码来源:CallTargetForModules_SerialUseTest.java

示例7: addConfiguredPropertyset

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
/**
 * A set of properties to pass from the build environment to the install compile
 *
 * @param ps The propertyset collection of properties
 */
public void addConfiguredPropertyset(PropertySet ps)
{
    if (properties == null)
    {
        properties = new Properties();
    }

    properties.putAll(ps.getProperties());
}
 
开发者ID:OpenNMS,项目名称:installer,代码行数:15,代码来源:IzPackTask.java

示例8: addConfiguredPropertySet

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
public void addConfiguredPropertySet(PropertySet ps) {
    properties.putAll(ps.getProperties());
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:4,代码来源:ExporterTask.java

示例9: initializeProject

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
/**
 * Attaches the build listeners of the current project to the new
 * project, configures a possible logfile, transfers task and
 * data-type definitions, transfers properties (either all or just
 * the ones specified as user properties to the current project,
 * depending on inheritall), transfers the input handler.
 */
private void initializeProject() {
    newProject.setInputHandler(getProject().getInputHandler());

    Iterator<BuildListener> iter = getBuildListeners();
    while (iter.hasNext()) {
        newProject.addBuildListener(iter.next());
    }

    if (output != null) {
        File outfile;
        if (dir != null) {
            outfile = FILE_UTILS.resolveFile(dir, output);
        } else {
            outfile = getProject().resolveFile(output);
        }
        try {
            out = new PrintStream(Files.newOutputStream(outfile.toPath()));
            DefaultLogger logger = new DefaultLogger();
            logger.setMessageOutputLevel(Project.MSG_INFO);
            logger.setOutputPrintStream(out);
            logger.setErrorPrintStream(out);
            newProject.addBuildListener(logger);
        } catch (IOException ex) {
            log("Ant: Can't set output to " + output);
        }
    }
    // set user-defined properties
    if (useNativeBasedir) {
        addAlmostAll(getProject().getUserProperties(), PropertyType.USER);
    } else {
        getProject().copyUserProperties(newProject);
    }

    if (!inheritAll) {
       // set Ant's built-in properties separately,
       // because they are not being inherited.
       newProject.initProperties();

    } else {
        // set all properties from calling project
        addAlmostAll(getProject().getProperties(), PropertyType.PLAIN);
    }

    for (PropertySet ps : propertySets) {
        addAlmostAll(ps.getProperties(), PropertyType.PLAIN);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:55,代码来源:Ant.java

示例10: configureSubModule

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
private Project configureSubModule(File file, File directory) {
    Project subModule = getProject().createSubProject();

    subModule.setNewProperty(EasyAntMagicNames.SUBMODULE, "true");

    subModule.setJavaVersionProperty();
    for (BuildListener buildListener : getProject().getBuildListeners()) {
        subModule.addBuildListener(buildListener);
    }
    // copy all User properties
    addAlmostAll(getProject().getUserProperties(), subModule, PropertyType.USER);
    // inherit meta.target directory, for shared build repository.
    String metaTarget = getProject().getProperty(EasyAntMagicNames.META_TARGET);
    if (metaTarget != null) {
        File metaDir = getProject().resolveFile(metaTarget);
        subModule.setNewProperty(EasyAntMagicNames.META_TARGET, metaDir.getAbsolutePath());
    }
    // inherit easyant offline base
    String offlineBaseDir = getProject().getProperty(EasyAntMagicNames.OFFLINE_BASE_DIRECTORY);
    if (offlineBaseDir != null) {
        subModule.setInheritedProperty(EasyAntMagicNames.OFFLINE_BASE_DIRECTORY, offlineBaseDir);
    }

    subModule.initProperties();

    // copy nested properties
    for (PropertySet ps : propertySets) {
        addAlmostAll(ps.getProperties(), subModule, PropertyType.PLAIN);
    }

    overrideProperties(subModule);
    addReferences(subModule);

    getEasyAntEngine().configureEasyAntIvyInstance(subModule);
    subModule.addReference(EasyAntMagicNames.PLUGIN_SERVICE_INSTANCE,
            getProject().getReference(EasyAntMagicNames.PLUGIN_SERVICE_INSTANCE));

    subModule.setName(file.getName());
    subModule.setBaseDir(directory);
    return subModule;
}
 
开发者ID:apache,项目名称:ant-easyant-core,代码行数:42,代码来源:SubModule.java

示例11: addPropertyset

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
@Override
public void addPropertyset(final PropertySet propertySet)
{
    propertySets.add(propertySet);
    super.addPropertyset(propertySet);
}
 
开发者ID:dzidzitop,项目名称:ant_modular,代码行数:7,代码来源:MockCallTargetTask.java

示例12: setPrefix

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
/**
 * If the prefix is set, then only properties which start with this
 * prefix string will be recorded. If regex is not set and  if this
 * is never set, or it is set to an empty string or <tt>null</tt>,
 * then all properties will be recorded.
 *
 * <p>For example, if the attribute is set as:</p>
 * <pre>&lt;echoproperties  prefix="ant." /&gt;</pre>
 * then the property "ant.home" will be recorded, but "ant-example"
 * will not.
 *
 * @param  prefix  The new prefix value
 */
public void setPrefix(String prefix) {
    if (prefix != null && prefix.length() != 0) {
        this.prefix = prefix;
        PropertySet ps = new PropertySet();
        ps.setProject(getProject());
        ps.appendPrefix(prefix);
        addPropertyset(ps);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:23,代码来源:EchoProperties.java

示例13: setRegex

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
/**
 * If the regex is set, then only properties whose names match it
 * will be recorded.  If prefix is not set and if this is never set,
 * or it is set to an empty string or <tt>null</tt>, then all
 * properties will be recorded.
 *
 * <p>For example, if the attribute is set as:</p>
 * <pre>&lt;echoproperties  prefix=".*ant.*" /&gt;</pre>
 * then the properties "ant.home" and "user.variant" will be recorded,
 * but "ant-example" will not.
 *
 * @param  regex  The new regex value
 *
 * @since Ant 1.7
 */
public void setRegex(String regex) {
    if (!(regex == null || regex.isEmpty())) {
        this.regex = regex;
        PropertySet ps = new PropertySet();
        ps.setProject(getProject());
        ps.appendRegex(regex);
        addPropertyset(ps);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:25,代码来源:EchoProperties.java

示例14: addSyspropertyset

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
/**
 * Adds a set of properties that will be used as system properties
 * that tests can access.
 *
 * <p>This might be useful to transfer Ant properties to the
 * testcases when JVM forking is not enabled.</p>
 *
 * @param sysp set of properties to be added
 * @since Ant 1.6
 */
public void addSyspropertyset(final PropertySet sysp) {
    getCommandline().addSyspropertyset(sysp);
}
 
开发者ID:apache,项目名称:ant,代码行数:14,代码来源:JUnitTask.java

示例15: addPropertyset

import org.apache.tools.ant.types.PropertySet; //导入依赖的package包/类
/**
 * A set of properties to write.
 * @param ps the property set to write
 * @since Ant 1.6
 */
public void addPropertyset(PropertySet ps) {
    propertySets.add(ps);
}
 
开发者ID:apache,项目名称:ant,代码行数:9,代码来源:EchoProperties.java


注:本文中的org.apache.tools.ant.types.PropertySet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。