private void checkForAnalyzerDiscriminator(XAnnotatedElement annotatedElement, PropertiesMetadata propertiesMetadata, ConfigContext context) {
AnalyzerDiscriminator discriminatorAnn = annotatedElement.getAnnotation( AnalyzerDiscriminator.class );
if ( discriminatorAnn != null ) {
if ( propertiesMetadata.discriminator != null ) {
throw new SearchException(
"Multiple AnalyzerDiscriminator defined in the same class hierarchy: " + beanXClass.getName()
);
}
if ( annotatedElement instanceof XProperty && isPropertyTransient( (XProperty)annotatedElement, context ) ) {
//if the discriminator is calculated on a @Transient field, we can't trust field level dirtyness
forceStateInspectionOptimizationsDisabled();
}
Class<? extends Discriminator> discriminatorClass = discriminatorAnn.impl();
try {
propertiesMetadata.discriminator = discriminatorClass.newInstance();
}
catch ( Exception e ) {
throw new SearchException(
"Unable to instantiate analyzer discriminator implementation: " + discriminatorClass.getName()
);
}
if ( annotatedElement instanceof XMember ) {