|
Re: QualifiedName for modelinferrer [message #1429466 is a reply to message #1428437] |
Tue, 23 September 2014 09:03 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Christian,
I'm afraid I couldn't follow your problem description.
entity.toClass( .. ) accepts (and has to accept) the FQN of your class.
Are you saying, that name cannot be computed from the entity alone?
packageName = .. appears to be redundant in the initializer. The package
name is computed from the FQN. Setting it separately won't work for your
initializer since the type was already indexed with the originally given
FQN.
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 21.09.14 23:30, schrieb Christian Pelster:
> Hi all,
>
> I mapped my model objects to java types using the jvm model inferrer:
>
>
> def dispatch void infer(Entity entity, IJvmDeclaredTypeAcceptor
> acceptor, boolean isPrelinkingPhase) {
>
> acceptor.accept(entity.toClass(entity.fullyQualifiedName)).initializeLater
> [
> documentation = entity.documentation
> packageName = serverNameUtils.entityFullQualifiedName(entity)
> ]
> }
>
>
> Lets assume an entity named Entity1, during the generator run when
> calling JvmReferenceType.literal I would normally expect the full
> qualified entity name, but I only get "Entity1" because the
> inferrer/generator doesn't know what the the full qualified classname
> of my generated entities will be.
>
> In the moment I fetch the corresponding EObject for each
> JvmReferenceType using the IJvmModelAssociations and use the EObject (in
> this case Entity) to determine my full qualified java name, but I guess
> there is (as always) an easier built in way.
>
> Thanks,
>
> Christian
|
|
|
|
Powered by
FUDForum. Page generated in 0.02315 seconds