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


Java EnumeratedAttribute类代码示例

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


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

示例1: getEnumeratedValues

import org.apache.tools.ant.types.EnumeratedAttribute; //导入依赖的package包/类
public String[] getEnumeratedValues(Class<?> c) {
    if (EnumeratedAttribute.class.isAssignableFrom(c)) {
        try {
            return ((EnumeratedAttribute)c.newInstance()).getValues();
        } catch (Exception e) {
            AntModule.err.notify(ErrorManager.INFORMATIONAL, e);
        }
    } else if (Enum.class.isAssignableFrom(c)) { // Ant 1.7.0 (#41058)
        try {
            Enum<?>[] vals = (Enum<?>[]) c.getMethod("values").invoke(null);
            String[] names = new String[vals.length];
            for (int i = 0; i < vals.length; i++) {
                names[i] = vals[i].name();
            }
            return names;
        } catch (Exception x) {
            Exceptions.printStackTrace(x);
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:BridgeImpl.java

示例2: ABoaIndex

import org.apache.tools.ant.types.EnumeratedAttribute; //导入依赖的package包/类
/**
 *
 * Constructor.
 *
 * @param file boa index
 */
public ABoaIndex(final String lang) {
  this.lang = lang;

  luceneIndexFolder = "data/boa/" + lang;
  if (!Files.exists(Paths.get(luceneIndexFolder))) {

    final File tarFile = Paths.get("data/boa/boa_" + lang + "_10.tar.gz").toFile();
    final Project p = new Project();
    final Untar ut = new Untar();
    ut.setProject(p);
    ut.setSrc(tarFile);
    if (tarFile.getName().endsWith(".gz")) {
      ut.setCompression((UntarCompressionMethod) EnumeratedAttribute
          .getInstance(UntarCompressionMethod.class, "gzip"));
    }
    ut.setDest(Paths.get(luceneIndexFolder).toFile());
    ut.perform();
  }

  createSupportedBoaRelations();
}
 
开发者ID:dice-group,项目名称:FOX,代码行数:28,代码来源:ABoaIndex.java

示例3: set

import org.apache.tools.ant.types.EnumeratedAttribute; //导入依赖的package包/类
public void set(Project p, Object parent, String value)
        throws InvocationTargetException, IllegalAccessException, BuildException {
    try {
        EnumeratedAttribute ea = (EnumeratedAttribute) reflectedArg.newInstance();
        ea.setValue(value);
        m.invoke(parent, new Object[]{ea});
    } catch (InstantiationException ie) {
        throw new BuildException(ie);
    }
}
 
开发者ID:fix-protocol-tools,项目名称:STAFF,代码行数:11,代码来源:IntrospectionHelper.java

示例4: tgzTo

import org.apache.tools.ant.types.EnumeratedAttribute; //导入依赖的package包/类
public TestFile tgzTo(TestFile tarFile) {
    Tar tar = new Tar();
    tar.setBasedir(this);
    tar.setDestFile(tarFile);
    tar.setCompression((Tar.TarCompressionMethod) EnumeratedAttribute.getInstance(Tar.TarCompressionMethod.class, "gzip"));
    execute(tar);
    return this;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:9,代码来源:TestFile.java

示例5: tbzTo

import org.apache.tools.ant.types.EnumeratedAttribute; //导入依赖的package包/类
public TestFile tbzTo(TestFile tarFile) {
    Tar tar = new Tar();
    tar.setBasedir(this);
    tar.setDestFile(tarFile);
    tar.setCompression((Tar.TarCompressionMethod) EnumeratedAttribute.getInstance(Tar.TarCompressionMethod.class, "bzip2"));
    execute(tar);
    return this;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:9,代码来源:TestFile.java

示例6: execSQL

import org.apache.tools.ant.types.EnumeratedAttribute; //导入依赖的package包/类
public static void execSQL(String scriptPath, String driveClass,
        String url, String user, String passwd) {
	SQLExec sqlExec = new SQLExec();
	sqlExec.setDriver(driveClass);
	sqlExec.setUrl(url);
	sqlExec.setUserid(user);
	sqlExec.setPassword(passwd);
	sqlExec.setSrc(new File(scriptPath));
	sqlExec.setOnerror((SQLExec.OnError) (EnumeratedAttribute.getInstance(
	        SQLExec.OnError.class, "abort")));
	sqlExec.setPrint(false);
	sqlExec.setProject(new Project());
	sqlExec.execute();
}
 
开发者ID:zhpooer,项目名称:itcast-customer-demo,代码行数:15,代码来源:DbUtil.java


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