import { ObjectMappingBuilder } from "./objectMappingBuilder" ; import { MappingModel } from "../mappingModel" ; hidden export class ClassMappingBuilder extends ObjectMappingBuilder { protected populateCore ( ) { var mapping = < MappingModel . ClassMapping > this . mapping ; mapping . name = this . type . name ; mapping . classConstructor = < any > this . type . ctr ; super . populateCore ( ) ; if ( mapping . flags & MappingModel . MappingFlags . InheritanceRoot ) { if ( ! mapping . discriminatorField ) { mapping . discriminatorField = this . context . config . discriminatorField ; } } if ( ! mapping . discriminatorValue && ( mapping . hasBaseClass || mapping . hasSubClasses ) ) { mapping . setDiscriminatorValue ( this . context . config . discriminatorNamingStrategy ( mapping . name ) ) ; } } }