org.joinedworkz.common.OpenApiGeneratorContext.xtend Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-base Show documentation
Show all versions of common-base Show documentation
DSL based modeling framework - facilities common base
package org.joinedworkz.common
import org.eclipse.xtend.lib.annotations.Accessors
import org.joinedworkz.core.facility.GeneratorContext
import org.joinedworkz.core.facility.Outlet
import org.joinedworkz.core.model.CmnModel
import org.joinedworkz.core.model.CmnType
@Accessors
class OpenApiGeneratorContext extends GeneratorContext {
final protected CmnModel model
new(CmnModel model, Outlet defaultOutlet) {
super(defaultOutlet)
this.model = model
}
def OpenApiGeneratorContext addUsedType(CmnType type) {
/* ensure that not multiple type (instances) with the same name are added */
for (usedType : usedTypes) {
if (type.name == usedType.name) {
return this
}
}
usedTypes.add(type)
return this
}
}