All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.joinedworkz.common.OpenApiGeneratorContext.xtend Maven / Gradle / Ivy

There is a newer version: 1.3.46
Show newest version
package org.joinedworkz.common

import org.eclipse.xtend.lib.annotations.Accessors
import org.joinedworkz.common.context.CommonGeneratorContext
import org.joinedworkz.core.facility.Outlet
import org.joinedworkz.core.model.CmnModel
import org.joinedworkz.core.model.CmnType
import java.util.Properties

@Accessors
class OpenApiGeneratorContext extends CommonGeneratorContext {
	
	final protected CmnModel model
	final public Outlet htmlOutlet
	
	new(CmnModel model, Outlet defaultOutlet, Outlet htmlOutlet, Properties properties) {
		super(defaultOutlet, properties)
		this.htmlOutlet = htmlOutlet
		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
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy