jvm - Xtext and Xtend: Interfaces inside folder -
i saw classes generated inside separate folder/package. interface files generated in root folder instead of generating inside specific package.
here code jvm inferrer:
def dispatch void infer(repository repo, ijvmdeclaredtypeacceptor acceptor, boolean isprelinkingphase) { acceptor.accept(repo.tointerface(repo.name, [])) [ documentation = repo.documentation annotations += annotationref(repository); supertypes += jparepository.typeref(repo.type.clonewithproxies,long.typeref); ] }
here model:
import dsltest.models.plant import dsltest.models.customer package dsltest.repositories { repo plantrepository : plant {} repo customerrepository : customer {} }
here generated files:
how make interface generate inside dsltest-> respositories -> customerrepository.java
the first parameter of tointerface method should qualifiedname e.g.
accept(entity.tointerface(entity.fullyqualifiedname,[]))[ ... ]
or
accept(entity.tointerface(ecoreutil2.getcontaineroftype(entity, package).name+"."+entity.name,[]))[ ... ]
Comments
Post a Comment