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


Java Factory.getEnvironment方法代码示例

本文整理汇总了Java中spoon.reflect.factory.Factory.getEnvironment方法的典型用法代码示例。如果您正苦于以下问题:Java Factory.getEnvironment方法的具体用法?Java Factory.getEnvironment怎么用?Java Factory.getEnvironment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在spoon.reflect.factory.Factory的用法示例。


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

示例1: printJavaFileWithComment

import spoon.reflect.factory.Factory; //导入方法依赖的package包/类
public static void printJavaFileWithComment(CtType<?> type, File directory) {
    Factory factory = type.getFactory();
    Environment env = factory.getEnvironment();
    env.setAutoImports(true);
    env.setCommentEnabled(true);
    JavaOutputProcessor processor = new JavaOutputProcessor(directory, new DefaultJavaPrettyPrinter(env));
    processor.setFactory(factory);
    processor.createJavaFile(type);
    env.setAutoImports(false);
}
 
开发者ID:STAMP-project,项目名称:dspot,代码行数:11,代码来源:DSpotUtils.java

示例2: printAllClasses

import spoon.reflect.factory.Factory; //导入方法依赖的package包/类
public static void printAllClasses(Factory factory, File out, File fileFrom) {
    Environment env = factory.getEnvironment();
    Processor processor = new JavaOutputProcessorWithFilter(out, new DefaultJavaPrettyPrinter(env), allClassesName(fileFrom));
    try {
        ProcessingManager pm = new QueueProcessingManager(factory);
        pm.addProcessor(processor);
        pm.process(factory.Package().getRootPackage());
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:12,代码来源:PrintClassUtils.java

示例3: printJavaFile

import spoon.reflect.factory.Factory; //导入方法依赖的package包/类
public static void printJavaFile(File directory, CtType type) throws IOException {
    try {
        Factory factory = type.getFactory();
        Environment env = factory.getEnvironment();

        JavaOutputProcessor processor = new JavaOutputProcessor(directory, new DefaultJavaPrettyPrinter(env));
        processor.setFactory(factory);

        processor.createJavaFile(type);
        Log.trace("write type {} in directory {}", type.getQualifiedName(), directory);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:15,代码来源:PrintClassUtils.java

示例4: printJavaFile

import spoon.reflect.factory.Factory; //导入方法依赖的package包/类
@Override
public void printJavaFile(String directory) throws IOException {
    CtType<?> type = getPosition().getCompilationUnit().getMainType();
    Factory factory = type.getFactory();
    Environment env = factory.getEnvironment();

    JavaOutputProcessor processor = new JavaOutputProcessor(new File(directory), new DefaultJavaPrettyPrinter(env));
    processor.setFactory(factory);

    processor.createJavaFile(type);
    Log.debug("write type {} in directory {}", type.getQualifiedName(), directory);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:13,代码来源:AddParameterCondition.java

示例5: printJavaFile

import spoon.reflect.factory.Factory; //导入方法依赖的package包/类
@Override
public void printJavaFile(String srcDir) throws IOException {
    CtType<?> type = loop.getParent(CtType.class);
    Factory factory = type.getFactory();
    Environment env = factory.getEnvironment();

    JavaOutputProcessor processor = new JavaOutputProcessor(new File(srcDir), new DefaultJavaPrettyPrinter(env));
    processor.setFactory(factory);

    processor.createJavaFile(type);
    Log.debug("write type {} in directory {}", type.getQualifiedName(), srcDir);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:13,代码来源:LoopPerforation.java

示例6: printJavaFile

import spoon.reflect.factory.Factory; //导入方法依赖的package包/类
@Override
public void printJavaFile(String directory) throws IOException {
    CtType<?> type = transformation.getOriginalClass(transformation.getTransplantationPoint());
    Factory factory = type.getFactory();
    Environment env = factory.getEnvironment();

    JavaOutputProcessor processor = new JavaOutputProcessor(new File(directory), new DefaultJavaPrettyPrinter(env));
    processor.setFactory(factory);

    processor.createJavaFile(type);
    Log.debug("write type {} in directory {}", type.getQualifiedName(), directory);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:13,代码来源:SwitchTransformation.java

示例7: printJavaFile

import spoon.reflect.factory.Factory; //导入方法依赖的package包/类
/**
 * Prints the modified java file. When the transformation is done a new java file is created. This method performs a
 * pretty print of it
 *
 * @param directory Directory where the java file is going to be placed
 * @throws IOException
 */
public void printJavaFile(String directory) throws IOException {
    CtType<?> type = getOriginalClass(transplantationPoint);
    Factory factory = type.getFactory();
    Environment env = factory.getEnvironment();

    JavaOutputProcessor processor = new JavaOutputProcessor(new File(directory), new DefaultJavaPrettyPrinter(env));
    processor.setFactory(factory);

    processor.createJavaFile(type);
    Log.debug("write type {} in directory {}", type.getQualifiedName(), directory);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:19,代码来源:SpoonTransformation.java

示例8: printJavaFile

import spoon.reflect.factory.Factory; //导入方法依赖的package包/类
public void printJavaFile(String directory) throws IOException {
    CtType<?> type = getPosition().getCompilationUnit().getMainType();
    Factory factory = type.getFactory();
    Environment env = factory.getEnvironment();

    JavaOutputProcessor processor = new JavaOutputProcessor(new File(directory), new DefaultJavaPrettyPrinter(env));
    processor.setFactory(factory);

    processor.createJavaFile(type);
    Log.debug("write type {} in directory {}", type.getQualifiedName(), directory);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:12,代码来源:SingleTransformation.java


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