本文整理汇总了Java中org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy类的典型用法代码示例。如果您正苦于以下问题:Java IErrorHandlingPolicy类的具体用法?Java IErrorHandlingPolicy怎么用?Java IErrorHandlingPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IErrorHandlingPolicy类属于org.eclipse.jdt.internal.compiler包,在下文中一共展示了IErrorHandlingPolicy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ecjErrorHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
protected IErrorHandlingPolicy ecjErrorHandlingPolicy() {
return new IErrorHandlingPolicy() {
public boolean stopOnFirstError() {
return true;
}
public boolean proceedOnErrors() {
return false;
}
@SuppressWarnings("all") // Added to the interface in later ecj version.
public boolean ignoreAllErrors() {
return false;
}
};
}
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:17,代码来源:RunTestsViaEcj.java
示例2: createDefaultProblemReporter
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
private static ProblemReporter createDefaultProblemReporter(CompilerOptions options) {
return new ProblemReporter(new IErrorHandlingPolicy() {
public boolean proceedOnErrors() {
return true;
}
public boolean stopOnFirstError() {
return false;
}
@Override
public boolean ignoreAllErrors() {
return false;
}
}, options, new DefaultProblemFactory(Locale.ENGLISH));
}
开发者ID:evant,项目名称:android-retrolambda-lombok,代码行数:17,代码来源:EcjTreeBuilder.java
示例3: createSilentProblemReporter
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
private static ProblemReporter createSilentProblemReporter(CompilerOptions options) {
return new ProblemReporter(new IErrorHandlingPolicy() {
public boolean proceedOnErrors() {
return true;
}
public boolean stopOnFirstError() {
return false;
}
@Override
public boolean ignoreAllErrors() {
return false;
}
}, options, SILENT_PROBLEM_FACTORY);
}
开发者ID:evant,项目名称:android-retrolambda-lombok,代码行数:17,代码来源:EcjTreeBuilder.java
示例4: getHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
@Override
public IErrorHandlingPolicy getHandlingPolicy() {
// passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)
return new IErrorHandlingPolicy() {
@Override
public boolean proceedOnErrors() {
return false; // stop if there are some errors
}
@Override
public boolean stopOnFirstError() {
return false;
}
@Override
public boolean ignoreAllErrors() {
return false;
}
};
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:EclipseCompilerImpl.java
示例5: CodeSnippetCompiler
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
/**
* Creates a new code snippet compiler initialized with a code snippet parser.
*/
public CodeSnippetCompiler(
INameEnvironment environment,
IErrorHandlingPolicy policy,
CompilerOptions compilerOptions,
ICompilerRequestor requestor,
IProblemFactory problemFactory,
EvaluationContext evaluationContext,
int codeSnippetStart,
int codeSnippetEnd) {
super(environment, policy, compilerOptions, requestor, problemFactory);
this.codeSnippetStart = codeSnippetStart;
this.codeSnippetEnd = codeSnippetEnd;
this.evaluationContext = evaluationContext;
this.parser =
new CodeSnippetParser(
this.problemReporter,
evaluationContext,
this.options.parseLiteralExpressionsAsConstants,
codeSnippetStart,
codeSnippetEnd);
this.parseThreshold = 1;
// fully parse only the code snippet compilation unit
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:CodeSnippetCompiler.java
示例6: internalResolveTentatively
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
MethodBinding internalResolveTentatively(TypeBinding targetType, Scope scope) {
// FIXME: could enclosingScope still be null here??
IErrorHandlingPolicy oldPolicy = this.enclosingScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
ExpressionContext previousContext = this.expressionContext;
MethodBinding previousBinding = this.binding;
MethodBinding previousDescriptor = this.descriptor;
TypeBinding previousResolvedType = this.resolvedType;
try {
setExpressionContext(INVOCATION_CONTEXT);
setExpectedType(targetType);
this.binding = null;
this.trialResolution = true;
resolveType(this.enclosingScope);
return this.binding;
} finally {
this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
// remove *any relevant* traces of this 'inofficial' resolving:
this.binding = previousBinding;
this.descriptor = previousDescriptor;
this.resolvedType = previousResolvedType;
setExpressionContext(previousContext);
this.expectedType = null; // don't call setExpectedType(null), would NPE
this.trialResolution = false;
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:ReferenceExpression.java
示例7: isCompatibleWith
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
public boolean isCompatibleWith(TypeBinding left, Scope scope) {
if (this.binding != null && this.binding.isValidBinding() // binding indicates if full resolution has already happened
&& this.resolvedType != null && this.resolvedType.isValidBinding()) {
return this.resolvedType.isCompatibleWith(left, scope);
}
// 15.28.2
left = left.uncapture(this.enclosingScope);
final MethodBinding sam = left.getSingleAbstractMethod(this.enclosingScope, true);
if (sam == null || !sam.isValidBinding())
return false;
boolean isCompatible;
setExpectedType(left);
IErrorHandlingPolicy oldPolicy = this.enclosingScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
try {
this.binding = null;
this.trialResolution = true;
resolveType(this.enclosingScope);
} finally {
this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
isCompatible = this.binding != null && this.binding.isValidBinding();
this.binding = null;
setExpectedType(null);
this.trialResolution = false;
}
return isCompatible;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:ReferenceExpression.java
示例8: compile
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
@Override
public CompilationResult compile(final Collection<String> sourceNames) {
final Map<String, byte[]> compiled = new HashMap<String, byte[]>();
final List<CompilationProblem> problems = new ArrayList<CompilationProblem>();
final List<ICompilationUnit> compilationUnits = collectCompilationUnits(sourceNames, problems);
// Exit if problems
if (! problems.isEmpty()) {
return new CompilationResult(problems);
}
// Setup compiler environment
final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
final INameEnvironment nameEnvironment = new NameEnvironment();
final ICompilerRequestor compilerRequestor = new CompilerRequestor(problems, compiled);
// Compile
final Compiler compiler = new Compiler(nameEnvironment, policy, new CompilerOptions(STANDARD_OPTIONS),
compilerRequestor, problemFactory);
compiler.compile(compilationUnits.toArray(new ICompilationUnit[0]));
return new CompilationResult(problems, compiled);
}
开发者ID:MattiasBuelens,项目名称:junit,代码行数:26,代码来源:EclipseCompiler.java
示例9: getErrorHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
protected IErrorHandlingPolicy getErrorHandlingPolicy() {
return new IErrorHandlingPolicy() {
@Override
public boolean proceedOnErrors() {
return true;
}
@Override
public boolean stopOnFirstError() {
return false;
}
@Override
public boolean ignoreAllErrors() {
return false;
}
};
}
开发者ID:CoCoViLa,项目名称:CoCoViLa,代码行数:20,代码来源:CCL.java
示例10: installStubs
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
public void installStubs(final Resource resource) {
boolean _isInfoFile = this.isInfoFile(resource);
if (_isInfoFile) {
return;
}
final CompilationUnit compilationUnit = this.getCompilationUnit(resource);
IErrorHandlingPolicy _proceedWithAllProblems = DefaultErrorHandlingPolicies.proceedWithAllProblems();
CompilerOptions _compilerOptions = this.getCompilerOptions(resource);
DefaultProblemFactory _defaultProblemFactory = new DefaultProblemFactory();
ProblemReporter _problemReporter = new ProblemReporter(_proceedWithAllProblems, _compilerOptions, _defaultProblemFactory);
final Parser parser = new Parser(_problemReporter, true);
final CompilationResult compilationResult = new CompilationResult(compilationUnit, 0, 1, (-1));
final CompilationUnitDeclaration result = parser.dietParse(compilationUnit, compilationResult);
if ((result.types != null)) {
for (final TypeDeclaration type : result.types) {
{
ImportReference _currentPackage = result.currentPackage;
char[][] _importName = null;
if (_currentPackage!=null) {
_importName=_currentPackage.getImportName();
}
List<String> _map = null;
if (((List<char[]>)Conversions.doWrapArray(_importName))!=null) {
final Function1<char[], String> _function = (char[] it) -> {
return String.valueOf(it);
};
_map=ListExtensions.<char[], String>map(((List<char[]>)Conversions.doWrapArray(_importName)), _function);
}
String _join = null;
if (_map!=null) {
_join=IterableExtensions.join(_map, ".");
}
final String packageName = _join;
final JvmDeclaredType jvmType = this.createType(type, packageName);
resource.getContents().add(jvmType);
}
}
}
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:40,代码来源:JavaDerivedStateComputer.java
示例11: compileUnits
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
@Override
protected String compileUnits(final JRCompilationUnit[] units, String classpath, File tempDirFile)
{
final INameEnvironment env = getNameEnvironment(units);
final IErrorHandlingPolicy policy =
DefaultErrorHandlingPolicies.proceedWithAllProblems();
final Map<String,String> settings = getJdtSettings();
final IProblemFactory problemFactory =
new DefaultProblemFactory(Locale.getDefault());
final CompilerRequestor requestor = getCompilerRequestor(units);
final Compiler compiler = new Compiler(env, policy, settings, requestor, problemFactory);
do
{
CompilationUnit[] compilationUnits = requestor.processCompilationUnits();
compiler.compile(compilationUnits);
}
while (requestor.hasMissingMethods());
requestor.processProblems();
return requestor.getFormattedProblems();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:30,代码来源:JRJdtCompiler.java
示例12: NonGeneratingCompiler
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
public NonGeneratingCompiler(INameEnvironment environment, IErrorHandlingPolicy policy,
CompilerOptions options, ICompilerRequestor requestor,
IProblemFactory problemFactory,
Map<ICompilationUnit, CompilationUnitDeclaration> units) {
super(environment, policy, options, requestor, problemFactory, null, null);
mUnits = units;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:EcjParser.java
示例13: HierarchyResolver
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
public HierarchyResolver(INameEnvironment nameEnvironment, Map settings, HierarchyBuilder builder, IProblemFactory problemFactory) {
// create a problem handler with the 'exit after all problems' handling policy
this.options = new CompilerOptions(settings);
IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitAfterAllProblems();
ProblemReporter problemReporter = new ProblemReporter(policy, this.options, problemFactory);
LookupEnvironment environment = new LookupEnvironment(this, this.options, problemReporter, nameEnvironment);
environment.mayTolerateMissingType = true;
setEnvironment(environment, builder);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:HierarchyResolver.java
示例14: getHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
protected static IErrorHandlingPolicy getHandlingPolicy() {
// passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)
return new IErrorHandlingPolicy() {
public boolean stopOnFirstError() {
return false;
}
public boolean proceedOnErrors() {
return false; // stop if there are some errors
}
public boolean ignoreAllErrors() {
return false;
}
};
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:CompilationUnitResolver.java
示例15: getHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
public IErrorHandlingPolicy getHandlingPolicy() {
// passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)
return new IErrorHandlingPolicy() {
public boolean proceedOnErrors() {
return Main.this.proceedOnError; // stop if there are some errors
}
public boolean stopOnFirstError() {
return false;
}
public boolean ignoreAllErrors() {
return false;
}
};
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:Main.java
示例16: getHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
@Override
public IErrorHandlingPolicy getHandlingPolicy() {
// passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)
return new IErrorHandlingPolicy() {
@Override
public boolean proceedOnErrors() {
return false; // stop if there are some errors
}
@Override
public boolean stopOnFirstError() {
return false;
}
};
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:15,代码来源:EclipseCompilerImpl.java
示例17: getHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
protected static IErrorHandlingPolicy getHandlingPolicy() {
// passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)
return new IErrorHandlingPolicy() {
public boolean stopOnFirstError() {
return false;
}
public boolean proceedOnErrors() {
return false; // stop if there are some errors
}
};
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:13,代码来源:CompilationUnitResolver.java
示例18: getHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
public IErrorHandlingPolicy getHandlingPolicy() {
// passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)
return new IErrorHandlingPolicy() {
public boolean proceedOnErrors() {
return Main.this.proceedOnError; // stop if there are some errors
}
public boolean stopOnFirstError() {
return false;
}
};
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:13,代码来源:Main.java
示例19: testBinaryOriginatingElements
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
@Test
public void testBinaryOriginatingElements() throws Exception {
// the point of this test is to assert Filer#createSourceFile does not puke when originatingElements are not sources
// originating source elements are used to cleanup generated outputs when corresponding sources change
// originating binary elements are not currently fully supported and are not tracked during incremental build
Classpath namingEnvironment = createClasspath();
IErrorHandlingPolicy errorHandlingPolicy = DefaultErrorHandlingPolicies.exitAfterAllProblems();
IProblemFactory problemFactory = ProblemFactory.getProblemFactory(Locale.getDefault());
CompilerOptions compilerOptions = new CompilerOptions();
ICompilerRequestor requestor = null;
Compiler compiler = new Compiler(namingEnvironment, errorHandlingPolicy, compilerOptions, requestor, problemFactory);
EclipseFileManager fileManager = new EclipseFileManager(null, Charsets.UTF_8);
File outputDir = temp.newFolder();
fileManager.setLocation(StandardLocation.SOURCE_OUTPUT, Collections.singleton(outputDir));
CompilerBuildContext context = null;
Map<String, String> processorOptions = null;
CompilerJdt incrementalCompiler = null;
ProcessingEnvImpl env = new ProcessingEnvImpl(context, fileManager, processorOptions, compiler, incrementalCompiler);
TypeElement typeElement = env.getElementUtils().getTypeElement("java.lang.Object");
FilerImpl filer = new FilerImpl(null /* context */, fileManager, null /* compiler */, null /* env */);
filer.createSourceFile("test.Source", typeElement);
}
开发者ID:takari,项目名称:takari-lifecycle,代码行数:29,代码来源:FilerImplTest.java
示例20: ecjErrorHandlingPolicy
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; //导入依赖的package包/类
protected IErrorHandlingPolicy ecjErrorHandlingPolicy() {
return new IErrorHandlingPolicy() {
@Override public boolean stopOnFirstError() {
return true;
}
@Override public boolean proceedOnErrors() {
return false;
}
};
}
开发者ID:redundent,项目名称:lombok,代码行数:12,代码来源:RunTestsViaEcj.java
注:本文中的org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论