import { IPropertyGenerator } from "./property/interfaces/IPropertyGenerator" ; import { XMLPropertyGenerator } from "./property/XMLPropertyGenerator" ; import { XMLAggregationGenerator } from "./aggregation/XMLAggregationGenerator" ; import { IAggregationGenerator } from "./aggregation/interfaces/IAggregationGenerator" ; import { UIDefineCompletionItemGenerator } from "./define/UIDefineCompletionItemGenerator" ; export class GeneratorFactory { private static readonly _generatorMap = { aggregation : { "xml" : XMLAggregationGenerator , "js" : XMLAggregationGenerator } , property : { "xml" : XMLPropertyGenerator , "js" : XMLPropertyGenerator } , define : { "xml" : undefined , "js" : UIDefineCompletionItemGenerator } } ; static getPropertyGenerator ( language ) { const propertyGenerator = new GeneratorFactory . _generatorMap [ GeneratorFactory . type . property ] [ language ] ; return propertyGenerator ; } static getAggregationGenerator ( language ) { const aggregationGenerator = new GeneratorFactory . _generatorMap [ GeneratorFactory . type . aggregation ] [ language ] ; return aggregationGenerator ; } static getDefineGenerator ( ) { return new GeneratorFactory . _generatorMap [ GeneratorFactory . type . define ] [ GeneratorFactory . language . js ] ; } } export namespace GeneratorFactory { export enum language { xml = "xml" , js = "js" } export enum type { property = "property" , aggregation = "aggregation" , define = "define" } }