sc.inheritance = new SpeedoInheritance(sc);
}
if (sc.inheritance.discriminatorValues == null) {
sc.inheritance.discriminatorValues = new HashMap();
}
SpeedoDiscriminator sd = sc.inheritance.discriminator;
if (sd == null || !sd.hasDiscriminator()) {
//find the discriminator
SpeedoClass current = sc;
while (current != null && sd == null) {
if (current.inheritance != null
&& current.inheritance.discriminator != null
&& current.inheritance.discriminator.hasDiscriminator()) {
sd = current.inheritance.discriminator;
} else {
String f = current.getExtensionValueByKey(INHERITANCE_FILTER);
if (f != null) {
sd = setDiscriminatorElement(current, f);
}
}
if (sd == null) {
current = current.getSuper();
}
}
if (sd == null || !sd.hasDiscriminator()) {
throw new SpeedoException("Extension '"
+ INHERITANCE_KEY
+ "' specified without filter definition in the "
+ sc.getSourceDesc());
}