private void checkStaticTypeCode( TraitableBean inner ) {
if ( ! inner.hasTraits() ) {
TraitTypeMap ttm = (TraitTypeMap) inner._getTraitMap();
if ( ttm != null && ttm.getStaticTypeCode() == null ) {
TraitRegistry registry = this.workingMemory.getKnowledgeBase().getConfiguration().getComponentFactory().getTraitRegistry();
// code that summarizes ALL the static types
BitSet staticCode = registry.getStaticTypeCode( inner.getClass().getName() );
ttm.setStaticTypeCode( staticCode );
if ( staticCode != null ) {
for ( String staticTrait : registry.getStaticTypes( inner.getClass().getName() ) ) {
ttm.addStaticTrait( staticTrait, registry.getHierarchy().getCode( staticTrait ) );
}
}
}
}
}