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


Java SourceProcessor类代码示例

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


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

示例1: processImports

import com.sun.cldc.jna.SourceProcessor; //导入依赖的package包/类
/**
 * Preprocess a given set of Java import file source files.
 *
 * @param   dstDir     the directory containing the generated Java src files (typically "native")
 * @param   srcDirs    the set of directories that are searched recursively for the source files to be imported
 * @param   j2me       specifies if the classes being compiled are to be deployed on a J2ME platform
 * @return the preprocessor output directory
 */
public File processImports(
        File dstDir,
        File[] srcDirs,
        boolean j2me) {
    // Get the preprocessor output directory
    SourceProcessor sp = new SourceProcessor();


    for (int i = 0; i != srcDirs.length; ++i) {

        File sourceDir = srcDirs[i];

        // A selector that matches a source file whose preprocessed copy does not exist,
        // is younger than the source file or has a last modification date
        // earlier than the last modification date of the properties
        FileSet.Selector outOfDate = new FileSet.DependSelector(new FileSet.SourceDestDirMapper(sourceDir, dstDir)) {

            public boolean isSelected(
                    File file) {
                if (super.isSelected(file)) {
                    return true;
                }
                File preprocessedFile = getMapper().map(file);
                long fileLastModified = preprocessedFile.lastModified();
                return (fileLastModified < env.propertiesLastModified);
            }
        };

        FileSet.Selector selector = new FileSet.AndSelector(JAVA_SOURCE_SELECTOR, outOfDate);
        FileSet fs = new FileSet(sourceDir, selector);
        sp.execute(fs, dstDir);
    }
    return dstDir;
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:43,代码来源:Build.java


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