• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Issues类的典型用法和代码示例

java 2次浏览

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

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

示例1: checkConfiguration

点赞 3

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	if (isCheckFileExtension()) {
		for (String extension : fileExtensions) {
			char[] charArray = extension.toCharArray();
			if (!Character.isJavaIdentifierPart(charArray[0])) {
				issues.addError("file extension '"+extension+"' starts with a non identifier letter : '"+charArray[0]+"'", this);
			}
			for (int i = 1; i < charArray.length; i++) {
				char c = charArray[i];
				if (!Character.isJavaIdentifierPart(c)) {
					issues.addError("file extension '"+extension+"' contains non identifier letter : '"+c+"'", this);
				}
			}
		}
	}
	if (getGrammar() == null) {
		issues.addError("property 'uri' is mandatory for element 'language'.", this);
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:22,
代码来源:LanguageConfig.java

示例2: toString

点赞 3

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
public String toString(Issues issues) {
	if (!issues.hasErrors() && !issues.hasWarnings())
		return "No issues.";
	StringBuilder result = new StringBuilder();
	if (issues.hasErrors()) {
		MWEDiagnostic[] errors = issues.getErrors();
		if (errors.length == 1) {
			result.append("1 error:\n");
		} else {
			result.append(errors.length).append(" errors:\n");
		}
		appendMessages(result, errors);
	}
	if (issues.hasWarnings()) {
		MWEDiagnostic[] warnings = issues.getWarnings();
		if (issues.hasErrors())
			result.append('\n');
		if (warnings.length == 1) {
			result.append("1 warning:\n");
		} else {
			result.append(warnings.length).append(" warnings:\n");
		}
		appendMessages(result, warnings);
	}
	return result.toString();
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:27,
代码来源:Validator.java

示例3: invokeInternal

点赞 3

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void invokeInternal(WorkflowContext ctx, ProgressMonitor monitor, Issues issues) {
	ResourceSet resourceSet = getResourceSet();
	Multimap<String, URI> uris = getPathTraverser().resolvePathes(pathes, new Predicate<URI>() {
		@Override
		public boolean apply(URI input) {
			boolean result = true;
			if (getUriFilter() != null)
				result = getUriFilter().matches(input);
			if (result)
				result = getRegistry().getResourceServiceProvider(input) != null;
			return result;
		}
	});
	IAllContainersState containersState = containersStateFactory.getContainersState(pathes, uris);
	installAsAdapter(resourceSet, containersState);
	populateResourceSet(resourceSet, uris);
	getValidator().validate(resourceSet, getRegistry(), issues);
	addModelElementsToContext(ctx, resourceSet);
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:21,
代码来源:Reader.java

示例4: main

点赞 3

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
public static void main(String[] args) {
	SadlStandaloneSetup.doSetup();
	
	SadlStandaloneSetup setup = new SadlStandaloneSetup();
	Injector injector = setup.createInjector();
	
	ResourceSet resourceSet = injector.getInstance(ResourceSet.class);
	resourceSet.setResourceFactoryRegistry(Resource.Factory.Registry.INSTANCE);
	URI uri = URI.createFileURI("resources/shape-rules.sadl");
	Assert.assertEquals("sadl", uri.fileExtension());
	Resource resource = resourceSet.getResource(uri, true);
	Validator validator = new Validator();
	Issues issues = new IssuesImpl();
	Registry registry = IResourceServiceProvider.Registry.INSTANCE;
	validator.validate(resourceSet, registry, issues);
	Assert.assertFalse(issues.hasErrors());
	int i=0;
}
 

开发者ID:crapo,
项目名称:sadlos2,
代码行数:19,
代码来源:SadlParseTest2.java

示例5: run

点赞 3

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
public void run() throws Exception {
	Issues issues = new IssuesImpl();
	WorkflowContext ctx = new WorkflowContextDefaultImpl();
	setupContext(ctx);
	
	try {
		setupOAWJob(oawJob);
		
		logger.info("Validating oAW configuration settings...");
		oawJob.checkConfiguration(issues);
		if (issues.hasErrors()) {
			String message = issues.toString();
			throw new Exception("oAW Job configuration is invalid: "+message);
		}
		
		logger.info("Running oAW task....");
		oawJob.invoke(ctx, new NullProgressMonitor(), issues);
		if (issues.hasErrors())
			throw new Exception("oAW Job failed: "+issues.getErrors());	
	} catch(Exception e) {
		throw new Exception("oAW Failed: "+e.getMessage(), e);
	}
}
 

开发者ID:aciancone,
项目名称:klapersuite,
代码行数:24,
代码来源:LazyXpand.java

示例6: execute

点赞 3

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
public void execute(IProgressMonitor monitor) throws Exception {
	Issues issues = new IssuesImpl();
	WorkflowContext ctx = new WorkflowContextDefaultImpl();
	setupContext(ctx);
	
	try {
		setupOAWJob(oawJob);
		
		logger.info("Validating oAW configuration settings...");
		oawJob.checkConfiguration(issues);
		if (issues.hasErrors()) {
			String message = issues.toString();
			throw new Exception("oAW Job configuration is invalid: "+message);
		}
		
		logger.info("Running oAW task....");
		oawJob.invoke(ctx, new ProgressMonitorAdapter(monitor), issues);
		if (issues.hasErrors())
			throw new Exception("oAW Job failed");	
	} catch(Exception e) {
		throw new Exception("oAW Failed",e);
	}
}
 

开发者ID:aciancone,
项目名称:klapersuite,
代码行数:24,
代码来源:LazyAbstractOAWWorkflow.java

示例7: invokeInternal

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void invokeInternal(WorkflowContext ctx, ProgressMonitor monitor,
		Issues issues) {
	ResourceSet resourceSet = getResourceSet();

	// due to some Xcore peculiarity we have to access the IAllContainerState here
	// to trigger some lazy init logic
	IAllContainersState allContainerState = (IAllContainersState) EcoreUtil.getAdapter(resourceSet.eAdapters(),
			IAllContainersState.class);
	allContainerState.isEmpty("");

	Multimap<String, URI> uris = getPathTraverser().resolvePathes(pathes,
			new Predicate<URI>() {
		@Override
		public boolean apply(URI input) {
			return input.fileExtension().equals(XCORE_FILE_EXT);
		}
	});
	List<Resource> resources = new ArrayList<>();
	for (URI uri : uris.values()) {
		LOGGER.info(uri);
		try {
			resources.add(parse(uri, resourceSet));
		} catch (Exception e) {
			LOGGER.error("Problem during loading of resource @ " + uri, e);
		}
	}
	installIndex(resourceSet);
	for (Resource r : resources) {
		EcoreUtil.resolveAll(r);
		for (Diagnostic x : r.getErrors()) {
			issues.addError(x.getMessage(), x);
		}

	}
	ctx.set(slot, resources);
}
 

开发者ID:eclipse,
项目名称:n4js,
代码行数:38,
代码来源:XcoreReader.java

示例8: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	if(generateJavaMain && generateXtendMain) {
		issues.addWarning("Options 'generateJavaMain' and 'generateXtendMain' are mutually exclusive. Generating Xtend only.");
		generateJavaMain = false;
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:9,
代码来源:GeneratorFragment.java

示例9: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	if (!antlrTool.isWorkable()) {
		issues.addError("\n\n*ATTENTION*\nIt is highly recommended to use ANTLR's parser generator (get it from 'http://xtext.itemis.com/'). \nAs an alternative to ANTLR you could also use the alternative implementation shipped with Xtext.\nTo do so use the generator fragment '"
				+ PackratParserFragment.class.getName() + "' in your mwe2 file instead.");
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:9,
代码来源:AbstractAntlrGeneratorFragment.java

示例10: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	if (getOptions().isBacktrackLexer()) {
		issues.addError("This fragment does not support the option 'backtracking' for the lexer. Use 'org.eclipse.xtext.generator.parser.antlr.ex.rt.AntlrGeneratorFragment' instead");
	}
	if (getOptions().isIgnoreCase()) {
		issues.addError("This fragment does not support the option 'ignorecase'. Use 'org.eclipse.xtext.generator.parser.antlr.ex.rt.AntlrGeneratorFragment' instead");
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:11,
代码来源:XtextAntlrGeneratorFragment.java

示例11: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	if (getOptions().isBacktrackLexer()) {
		issues.addError("This fragment does not support the option 'backtracking' for the lexer. Use 'org.eclipse.xtext.generator.parser.antlr.ex.ca.ContentAssistParserGeneratorFragment' instead");
	}
	if (getOptions().isIgnoreCase()) {
		issues.addError("This fragment does not support the option 'ignoreCase'. Use 'org.eclipse.xtext.generator.parser.antlr.ex.ca.ContentAssistParserGeneratorFragment' instead");
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:11,
代码来源:XtextAntlrUiGeneratorFragment.java

示例12: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	if (getNaming().getPathTestProject()==null) {
		issues.addWarning("Missing test project path configuration 'Generator#pathTestProject' required for fragment '"+getClass().getName()+"'.");
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:8,
代码来源:Junit4Fragment.java

示例13: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	if (delegate == null && message != null) {
		issues.addWarning("---- ATTENTION----\n\t" + "\n\n\t" + message);
	}
	if (fallback instanceof NamingAware)
		((NamingAware) fallback).registerNaming(getNaming());
	if (delegate instanceof NamingAware)
		((NamingAware) delegate).registerNaming(getNaming());
	if (delegate != null)
		delegate.checkConfiguration(issues);
	else
		fallback.checkConfiguration(issues);
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:15,
代码来源:DelegatingGeneratorFragment.java

示例14: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	if (getInstance() == null) {
		issues.addError(getMessage());
	}
	else {
		getInstance().checkConfiguration(issues);
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:11,
代码来源:AntlrDelegatingFragment.java

示例15: checkConfigurationInternal

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void checkConfigurationInternal(Issues issues) {
	naming.setProjectNameRt(getProjectNameRt());
	naming.setProjectNameIde(getProjectNameIde());
	naming.setIdeBasePackage(!isIde() && isUi() ? getProjectNameUi() : getProjectNameIde());
	naming.setProjectNameUi(getProjectNameUi());
	naming.setUiBasePackage(getProjectNameUi());
	naming.setActivatorName(getActivator());
	naming.setPathTestProject(getPathTestProject());
	naming.setFileHeader(getFileHeader());
	naming.setClassAnnotations(getClassAnnotationsAsString());
	naming.setAnnotationImports(getAnnotationImportsAsString());
	naming.setHasUI(isUi());
	naming.setHasIde(isIde());
	Map<String, Grammar> uris = new HashMap<String, Grammar>();
	for (LanguageConfig config : languageConfigs) {
		config.registerNaming(naming);
		config.checkConfiguration(issues);
		Grammar grammar = config.getGrammar();
		List<GeneratedMetamodel> select = EcoreUtil2.typeSelect(grammar.getMetamodelDeclarations(),
				GeneratedMetamodel.class);
		for (GeneratedMetamodel generatedMetamodel : select) {
			String nsURI = generatedMetamodel.getEPackage().getNsURI();
			if (uris.containsKey(nsURI)) {
				issues.addError("Duplicate generated grammar with nsURI '" + nsURI + "' in "
						+ uris.get(nsURI).getName() + " and " + grammar.getName());
			} else {
				uris.put(nsURI, grammar);
			}
		}
	}
	if (getProjectNameRt() == null)
		issues.addError("The property 'projectNameRt' is mandatory");
	if (isUiMergedIntoRt() && getPathIdeProject() != null && ! isIdeMergedIntoRt()) {
		issues.addError("Cannot have a dedicated ide project when ui project is merged into runtime project");
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:38,
代码来源:Generator.java

示例16: handleCompositeException

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
private void handleCompositeException(Issues issues, CompositeGeneratorException e) {
	for (Exception ex : e.getExceptions()) {
		if (ex instanceof CompositeGeneratorException) {
			handleCompositeException(issues, (CompositeGeneratorException) ex);
		} else if (!(ex instanceof GeneratorWarning)) {
			issues.addError(this, "GeneratorException: ", null, ex, null);
		}
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:10,
代码来源:Generator.java

示例17: handleWarnings

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
private boolean handleWarnings(Issues issues, CompositeGeneratorException e) {
	for (Exception ex : e.getExceptions()) {
		if (ex instanceof CompositeGeneratorException) {
			if (!handleWarnings(issues, (CompositeGeneratorException) ex)) {
				return false;
			}
		} else if (ex instanceof GeneratorWarning) {
			issues.addWarning(this, "Warning: " + ex.getMessage(), null, null, null);
		} else {
			return false;
		}
	}
	return true;
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:15,
代码来源:Generator.java

示例18: generate

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
private void generate(LanguageConfig config, XpandExecutionContext ctx, Issues issues) {
	try {
		config.generate(config, ctx);
	} catch(CompositeGeneratorException e) {
		if (!handleWarnings(issues, e)) {
			throw e;
		}
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:10,
代码来源:Generator.java

示例19: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	issues.addWarning("Fragment org.eclipse.xtext.ui.generator.BasicUiGeneratorFragment is deprecated and not needed anymore. Just remove it from the mwe configuration.");
	if (fileExtensions!=null)
		issues.addError("the fileExtensions property has been moved to the main language configuration. \n\tPlease change your *.mwe file to something like \n\n\t"
					+ "<language uri='${grammarURI}' fileExtensions='" + fileExtensions + "'> \n\t\t <-- fragments go here ... --> \n\t</languageConfig>\n\n",this);
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:8,
代码来源:BasicUiGeneratorFragment.java

示例20: validate

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
public void validate(ResourceSet resourceSet, IResourceServiceProvider.Registry registry, Issues issues) {
	List<Resource> resources = Lists.newArrayList(resourceSet.getResources());
	for (Resource resource : resources) {
		try {
			resource.load(null);
			IResourceServiceProvider provider = registry.getResourceServiceProvider(resource.getURI());
			if (provider != null) {
				List<Issue> result = provider.getResourceValidator().validate(resource, CheckMode.ALL, null);
				for (Issue issue : result) {
					switch (issue.getSeverity()) {
						case ERROR:
							issues.addError(issue.getMessage(), issue);
							break;
						case WARNING:
							issues.addWarning(issue.getMessage(), issue);
							break;
						case INFO:
							issues.addInfo(issue.getMessage(), issue);
							break;
						case IGNORE:
							break;
					}
				}
			}
		} catch (IOException e) {
			throw new WorkflowInterruptedException("Couldn't load resource (" + resource.getURI() + ")", e);
		}
	}
	if (isStopOnError() && issues.hasErrors()) {
		String errorMessage = toString(issues);
		throw new WorkflowInterruptedException("Validation problems: \n" + errorMessage);
	}
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:34,
代码来源:Validator.java

示例21: checkConfigurationInternal

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void checkConfigurationInternal(Issues issues) {
	super.checkConfigurationInternal(issues);
	if (uris.isEmpty())
		issues.addError(this, "No resource uri configured (property 'uri')");
	for (String uri : uris) {
		try {
			uris2.add(URI.createURI(uri));
		} catch (Exception e) {
			issues.addError(this, "Invalid URI '" + uri + "' (" + e.getMessage() + ")");
		}
	}
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:14,
代码来源:UriBasedReader.java

示例22: invokeInternal

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void invokeInternal(WorkflowContext ctx, ProgressMonitor monitor, Issues issues) {
	ResourceSet resourceSet = getResourceSet();
	for (URI uri : uris2) {
		Resource resource = resourceSet.getResource(uri, true);
		int numberResources;
		do {
			numberResources = resourceSet.getResources().size();
			EcoreUtil.resolveAll(resource);
		} while (numberResources!=resourceSet.getResources().size());
	}
	getValidator().validate(resourceSet, getRegistry(), issues);
	addModelElementsToContext(ctx, resourceSet);
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:15,
代码来源:UriBasedReader.java

示例23: checkConfigurationInternal

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void checkConfigurationInternal(Issues issues) {
	super.checkConfigurationInternal(issues);
	if (injectors.isEmpty())
		issues.addError(this,"No setup has been registered (example <register class='foo.bar.MyLanguageStandaloneSetup')");
	if (slotEntries.isEmpty()) {
		issues.addError(this,"No slot entries configured (example <load slot='mySlot' type='Type'/>).");
	}
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:10,
代码来源:AbstractReader.java

示例24: checkConfigurationInternal

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void checkConfigurationInternal(Issues issues) {
	super.checkConfigurationInternal(issues);
	if (pathes.isEmpty()) {
		issues.addWarning("No path set, using java class path entries (useJavaClassPath='true').");
		setUseJavaClassPath(true);
	}
	if (log.isDebugEnabled()) {
		log.debug("Resource Pathes : " + pathes);
	}
	for (String path : pathes) {
		if (!new File(path).exists())
			issues.addWarning("Skipping the path '" + path + "', because it does not exist.");
	}
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:16,
代码来源:Reader.java

示例25: checkConfigurationInternal

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void checkConfigurationInternal(final Issues issues) {
  this.initialize();
  final MweIssues generatorIssues = new MweIssues(this, issues);
  this.configuration.checkConfiguration(generatorIssues);
  final HashMap<String, Grammar> uris = new HashMap<String, Grammar>();
  for (final XtextGeneratorLanguage language : this.languageConfigs) {
    {
      language.checkConfiguration(generatorIssues);
      Iterable<GeneratedMetamodel> _filter = Iterables.<GeneratedMetamodel>filter(language.getGrammar().getMetamodelDeclarations(), GeneratedMetamodel.class);
      for (final GeneratedMetamodel generatedMetamodel : _filter) {
        {
          final String nsURI = generatedMetamodel.getEPackage().getNsURI();
          boolean _containsKey = uris.containsKey(nsURI);
          if (_containsKey) {
            String _name = uris.get(nsURI).getName();
            String _plus = ((("Duplicate generated grammar with nsURI \'" + nsURI) + "\' in ") + _name);
            String _plus_1 = (_plus + " and ");
            String _name_1 = language.getGrammar().getName();
            String _plus_2 = (_plus_1 + _name_1);
            generatorIssues.addError(_plus_2);
          } else {
            uris.put(nsURI, language.getGrammar());
          }
        }
      }
    }
  }
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:30,
代码来源:XtextGenerator.java

示例26: invokeInternal

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
protected void invokeInternal(final WorkflowContext ctx, final ProgressMonitor monitor, final Issues issues) {
  this.initialize();
  try {
    this.cleaner.clean();
    for (final XtextGeneratorLanguage language : this.languageConfigs) {
      try {
        String _name = language.getGrammar().getName();
        String _plus = ("Generating " + _name);
        XtextGenerator.LOG.info(_plus);
        language.generate();
        this.generateSetups(language);
        this.generateModules(language);
        this.generateExecutableExtensionFactory(language);
      } catch (final Throwable _t) {
        if (_t instanceof Exception) {
          final Exception e = (Exception)_t;
          this.handleException(e, issues);
        } else {
          throw Exceptions.sneakyThrow(_t);
        }
      }
    }
    XtextGenerator.LOG.info("Generating common infrastructure");
    this.generatePluginXmls();
    this.generateManifests();
    this.generateActivator();
    this.generateServices();
  } catch (final Throwable _t_1) {
    if (_t_1 instanceof Exception) {
      final Exception e_1 = (Exception)_t_1;
      this.handleException(e_1, issues);
    } else {
      throw Exceptions.sneakyThrow(_t_1);
    }
  }
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:38,
代码来源:XtextGenerator.java

示例27: handleException

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
private void handleException(final Exception ex, final Issues issues) {
  if ((ex instanceof CompositeGeneratorException)) {
    final Consumer<Exception> _function = (Exception it) -> {
      this.handleException(it, issues);
    };
    ((CompositeGeneratorException)ex).getExceptions().forEach(_function);
  } else {
    issues.addError(this, "GeneratorException: ", null, ex, null);
  }
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:11,
代码来源:XtextGenerator.java

示例28: testBugFix322645

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
/**
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=322645
 */
@Test public void testBugFix322645() throws Exception {
	Issues issues = issues();
	Issue a = new Issue.IssueImpl();
	Issue b = new Issue.IssueImpl();
	issues.addError("foo", a);
	issues.addWarning(null, a);
	issues.addError(null, b);
	MWEDiagnostic[] errors = issues.getErrors();
	assertEquals(2, errors.length);
	final Validator validator = new Validator();
	final String string = validator.toString(issues);
	assert(string.contains("foo"));
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:17,
代码来源:ValidatorTest.java

示例29: testLoadTwo

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Test public void testLoadTwo() throws Exception {
	Reader reader = getReader();
	reader.addPath(pathTo("emptyFolder"));
	reader.addPath(pathTo("nonemptyFolder"));
	reader.addRegister(new IndexTestLanguageStandaloneSetup());
	SlotEntry entry = createSlotEntry();
	entry.setSlot("person");
	entry.setName("foo.bar.Person");
	entry.setNamespaceDelimiter(".");
	entry.setFirstOnly(true);
	SlotEntry entry2 = createSlotEntry();
	entry2.setSlot("string");
	entry2.setName("foo.bar.sub.String");
	entry2.setNamespaceDelimiter(".");
	entry2.setFirstOnly(true);
	reader.addLoad(entry);
	reader.addLoad(entry2);
	WorkflowContext ctx = ctx();
	Issues issues = issues();
	try {
		reader.invoke(ctx, monitor(), issues);
	} catch (Exception e) {
		System.out.println(issues);
		throw e;
	}
	assertEquals("Person", ((Entity) ctx.get("person")).getName());
	assertEquals("String", ((Datatype) ctx.get("string")).getName());
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:29,
代码来源:ReaderTest.java

示例30: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(final Issues issues) {
  super.checkConfiguration(issues);
  if (getOptions().isBacktrackLexer() && getOptions().isIgnoreCase()) {
    issues.addError("Backtracking lexer and ignorecase cannot be combined for now.");
  }
}
 

开发者ID:antlr4ide,
项目名称:antlr4ide,
代码行数:8,
代码来源:AntlrGeneratorFragmentWithCustomLexer.java

示例31: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	for (IGeneratorFragment fragment : fragments) {
		fragment.checkConfiguration(issues);
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:7,
代码来源:CompositeGeneratorFragment.java

示例32: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	if (contentAssist && highlighting || runtime && highlighting || contentAssist && runtime) {
		issues.addError("Only one of those flags is allowed: contentAssist, runtime, highlighting flag");
	}
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:7,
代码来源:ExternalAntlrLexerFragment.java

示例33: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	if(getOptions().isBacktrackLexer() && getOptions().isIgnoreCase())
		issues.addError("Backtracking lexer and ignorecase cannot be combined for now.");
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:7,
代码来源:AntlrGeneratorFragment.java

示例34: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
	super.checkConfiguration(issues);
	issues.addInfo("Generate debugging grammar file");
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:6,
代码来源:DebugAntlrGeneratorFragment.java

示例35: checkConfiguration

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@Override
public void checkConfiguration(Issues issues) {
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:4,
代码来源:DefaultGeneratorFragment.java

示例36: issues

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
protected Issues issues() {
	return new IssuesImpl();
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:4,
代码来源:AbstractReaderTest.java

示例37: testShadowingPathes

点赞 2

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test public void testShadowingPathes() throws Exception {
	Reader reader = getReader();
	// also test adding multiple paths as comma-separated list, see bug#356750
	reader.addPath(
		       pathTo("shadowingtest/folder 1")
		+","  +pathTo("shadowingtest/folder 2")
		+" , "+pathTo("shadowingtest/folder 3"));
	reader.addRegister(new IndexTestLanguageStandaloneSetup());
	SlotEntry entry = createSlotEntry();
	entry.setType("Entity");
	reader.addLoad(entry);
	SlotEntry entry2 = createSlotEntry();
	entry2.setType("Datatype");
	entry2.setSlot("stringTypes");
	entry2.setName("String");
	reader.addLoad(entry2);
	SlotEntry entry3 = createSlotEntry();
	entry3.setType("Datatype");
	entry3.setSlot("booleanTypes");
	entry3.setName("Boolean");
	reader.addLoad(entry3);
	
	WorkflowContext ctx = ctx();
	Issues issues = issues();
	try {
		reader.invoke(ctx, monitor(), issues);
	} catch (Exception e) {
		System.out.println(issues);
		throw e;
	}
	List<Entity> entities = (List<Entity>) ctx.get(entry.getSlot());
	List<Datatype> stringTypes = (List<Datatype>) ctx.get(entry2.getSlot());
	List<Datatype> booleanTypes = (List<Datatype>) ctx.get(entry3.getSlot());
	
	assertEquals(3,entities.size());
	assertEquals(2,stringTypes.size());
	assertEquals(2,booleanTypes.size());
	
	Entity ent1 = Iterables.find(entities, getPredicate("1"));
	Entity ent2 = Iterables.find(entities, getPredicate("2"));
	Entity ent3 = Iterables.find(entities, getPredicate("3"));
	Datatype string2 = Iterables.find(stringTypes, getPredicate("2"));
	Datatype string3 = Iterables.find(stringTypes, getPredicate("3"));
	Datatype bool1 = Iterables.find(booleanTypes, getPredicate("1"));
	Datatype bool2 = Iterables.find(booleanTypes, getPredicate("2"));
	
	assertEquals(string2,ent1.getProperties().get(0).getType());
	assertEquals(bool1, ent1.getProperties().get(1).getType());
	assertEquals(ent1,ent1.getProperties().get(2).getType());

	assertEquals(string2,ent2.getProperties().get(0).getType());
	assertEquals(bool2, ent2.getProperties().get(1).getType());
	assertEquals(ent2,ent2.getProperties().get(2).getType());
	
	assertEquals(string3,ent3.getProperties().get(0).getType());
	assertEquals(bool1, ent3.getProperties().get(1).getType());
	assertEquals(ent3,ent3.getProperties().get(2).getType());
	
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:61,
代码来源:ReaderTest.java

示例38: checkConfiguration

点赞 1

import org.eclipse.emf.mwe.core.issues.Issues; //导入依赖的package包/类
/**
* Called by the container after configuration so the component can validate
* the configuration before invocation.
   *
* @param issues
   *            implementors should report configuration issues to this.
   */
  public void checkConfiguration(Issues issues);
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:9,
代码来源:IGeneratorFragment.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)