@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
14 lines • 539 B
JavaScript
import { NotImplementedException } from "@aurigma/design-atoms-model/Exception";
export class ObjectFactory {
constructor(types) {
const mapData = types.map(t => [t.typeName, t]);
this._dict = new Map(mapData);
}
create(itemHandlerType) {
const objectCtor = this._dict.get(itemHandlerType);
if (objectCtor != null)
return new objectCtor();
throw new NotImplementedException(`Unknown vo type ${itemHandlerType}`);
}
}
//# sourceMappingURL=ObjectFactory.js.map