private static SoyMsgSelectPart buildMsgPartForSelect ( MsgSelectNode msgSelectNode , MsgNode msgNode ) { // This is the list of the cases. ImmutableList . Builder < SoyMsgPart . Case < String >> selectCases = ImmutableList . builder ( ) ; for ( CaseOrDefaultNode child : msgSelectNode . getChildren ( ) ) { ImmutableList < SoyMsgPart > caseMsgParts = buildMsgPartsForChildren ( ( MsgBlockNode ) child , msgNode ) ; String caseValue ; if ( child instanceof MsgSelectCaseNode ) { caseValue = ( ( MsgSelectCaseNode ) child ) . getCaseValue ( ) ; } else if ( child instanceof MsgSelectDefaultNode ) { caseValue = null ; } else { throw new AssertionError ( "Unidentified node under a select node." ) ; } selectCases . add ( SoyMsgPart . Case . create ( caseValue , caseMsgParts ) ) ; } return new SoyMsgSelectPart ( msgNode . getSelectVarName ( msgSelectNode ) , selectCases . build ( ) ) ; }
Builds the list of SoyMsgParts for the given MsgSelectNode .