private void createSequence ( ClassWriter classWriter , Stream < XsdAbstractElement > xsdElements , String className , int interfaceIndex , String apiName , String groupName ) { SequenceMethodInfo sequenceInfo = getSequenceInfo ( xsdElements , className , interfaceIndex , 0 , apiName , groupName ) ; List < XsdAbstractElement > sequenceList = new ArrayList <> ( ) ; List < String > sequenceNames = new ArrayList <> ( ) ; sequenceList . addAll ( sequenceInfo . getSequenceElements ( ) ) ; sequenceNames . add ( className ) ; sequenceNames . addAll ( sequenceInfo . getSequenceElementNames ( ) ) ; for ( int i = 0 ; i < sequenceNames . size ( ) ; i ++ ) { boolean isLast = i == sequenceNames . size ( ) - 1 ; boolean willPointToLast = i == sequenceNames . size ( ) - 2 ; String typeName = getNextTypeName ( className , groupName , firstToLower ( getCleanName ( sequenceNames . get ( i ) ) ) , isLast ) ; if ( isLast ) { if ( ! typeName . equals ( className ) ) { createdElements . put ( getCleanName ( typeName ) , null ) ; writeClassToFile ( typeName , generateInnerSequenceClass ( typeName , className , apiName ) , apiName ) ; } break ; } String nextTypeName = getNextTypeName ( className , groupName , firstToLower ( getCleanName ( sequenceNames . get ( i + 1 ) ) ) , willPointToLast ) ; createSequenceClasses ( sequenceList . get ( i ) , classWriter , className , typeName , nextTypeName , apiName , i == 0 ) ; ++ interfaceIndex ; } }
Obtains sequence information and creates all the required classes and methods .