private void addIndexedDiscriminators ( final Class < ? > clazz ) { if ( clazz == Object . class ) return ; this . addIndexedDiscriminators ( clazz . getSuperclass ( ) ) ; final Subclass sub = clazz . getAnnotation ( Subclass . class ) ; if ( sub != null && sub . index ( ) ) { final String disc = ( sub . name ( ) . length ( ) > 0 ) ? sub . name ( ) : clazz . getSimpleName ( ) ; this . indexedDiscriminators . add ( StringValue . of ( disc ) ) ; } }
Recursively go through the class hierarchy adding any discriminators that are indexed