Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Extending Domainmodel example: Adding own TypeComputer
Extending Domainmodel example: Adding own TypeComputer [message #1712604] Mon, 26 October 2015 17:45 Go to next message
Ingo Meyer is currently offline Ingo MeyerFriend
Messages: 162
Registered: July 2009
Senior Member
Hello everybody,

this must be a stupid small thing, but when I add an own TypeComputer in the domainmodel example like
public class DomainmodelRuntimeModule extends AbstractDomainmodelRuntimeModule {
	
	@Override
	public Class<? extends ITypeComputer> bindITypeComputer() {
		return PidoTypeComputer.class;
	}
	
	public Class<? extends IResourceStorageFacade> bindResourceStorageFacade() {
		return BatchLinkableResourceStorageFacade.class;
	}
}


I get the following error when running the Eclipse via "Run as":
!MESSAGE org.eclipse.xtext.example.domainmodel.ui.internal.DomainmodelActivator  - Guice creation errors:

1) No implementation for org.eclipse.xtext.xbase.XExpression was bound.
  while locating org.eclipse.xtext.xbase.XExpression
    for parameter 0 at org.eclipse.xtext.example.domainmodel.typesystem.PidoTypeComputer.computeTypes(Unknown Source)
  at org.eclipse.xtext.example.domainmodel.typesystem.PidoTypeComputer.computeTypes(Unknown Source)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:57)

2) No implementation for org.eclipse.xtext.xbase.typesystem.computation.ITypeComputationState was bound.
  while locating org.eclipse.xtext.xbase.typesystem.computation.ITypeComputationState
    for parameter 1 at org.eclipse.xtext.example.domainmodel.typesystem.PidoTypeComputer.computeTypes(Unknown Source)
  at org.eclipse.xtext.example.domainmodel.typesystem.PidoTypeComputer.computeTypes(Unknown Source)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:57)

2 errors


I don't thinki that a binding of all method parameter is needed, so why is Guice doing that???

Thanks,
Ingo
Re: Extending Domainmodel example: Adding own TypeComputer [message #1712607 is a reply to message #1712604] Mon, 26 October 2015 17:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
How does your type computer impl look like?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Extending Domainmodel example: Adding own TypeComputer [message #1712608 is a reply to message #1712607] Mon, 26 October 2015 17:52 Go to previous messageGo to next message
Ingo Meyer is currently offline Ingo MeyerFriend
Messages: 162
Registered: July 2009
Senior Member
It looks like this:
public class PidoTypeComputer extends XbaseWithAnnotationsTypeComputer {

	@Inject
//	private IXtendJvmAssociations associations;

	@Override
	public void computeTypes(XExpression expression, ITypeComputationState state) {
		if (expression instanceof XI18NLiteral) {
			_computeTypes((XI18NLiteral) expression, state);
		} else {
			super.computeTypes(expression, state);
		}
	}

	protected void _computeTypes(XI18NLiteral anonymousClass, ITypeComputationState state) {
		LightweightTypeReference string = getRawTypeForName(String.class, state);
		state.acceptActualType(string);
	}
}
Re: Extending Domainmodel example: Adding own TypeComputer [message #1712610 is a reply to message #1712608] Mon, 26 October 2015 17:55 Go to previous message
Ingo Meyer is currently offline Ingo MeyerFriend
Messages: 162
Registered: July 2009
Senior Member
Ahh, I see...
The @Inject is not commented out!
It was a long day today, sorry
Previous Topic:Grammar related help
Next Topic:Meaning of: feature was simple feature call but got receiver instead of null
Goto Forum:
  


Current Time: Fri Apr 19 21:59:12 GMT 2024

Powered by FUDForum. Page generated in 0.03218 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top