org.joinedworkz.common.OpenApiGeneratorContext.xtend Maven / Gradle / Ivy
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
}
}