private List < String > getBaseAttributeGroupInterface ( List < XsdAttributeGroup > attributeGroups ) { List < XsdAttributeGroup > parents = new ArrayList <> ( ) ; attributeGroups . forEach ( attributeGroup -> { XsdAbstractElement parent = attributeGroup . getParent ( ) ; if ( parent instanceof XsdAttributeGroup && ! parents . contains ( parent ) ) { parents . add ( ( XsdAttributeGroup ) parent ) ; } } ) ; if ( attributeGroups . size ( ) == 1 || parents . isEmpty ( ) ) { return attributeGroups . stream ( ) . map ( attributeGroup -> firstToUpper ( attributeGroup . getName ( ) ) ) . collect ( Collectors . toList ( ) ) ; } return getBaseAttributeGroupInterface ( parents ) ; }
Recursively iterates order to define an hierarchy on the attribute group interfaces .