private Statement handleBasicTranslation ( List < SoyPrintDirective > escapingDirectives , Expression soyMsgParts ) { // optimize for simple constant translations (very common) // this becomes: renderContext.getSoyMessge(<id>).getParts().get(0).getRawText() SoyExpression text = SoyExpression . forString ( soyMsgParts . invoke ( MethodRef . LIST_GET , constant ( 0 ) ) . checkedCast ( SoyMsgRawTextPart . class ) . invoke ( MethodRef . SOY_MSG_RAW_TEXT_PART_GET_RAW_TEXT ) ) ; // Note: there is no point in trying to stream here, since we are starting with a constant // string. for ( SoyPrintDirective directive : escapingDirectives ) { text = parameterLookup . getRenderContext ( ) . applyPrintDirective ( directive , text ) ; } return appendableExpression . appendString ( text . coerceToString ( ) ) . toStatement ( ) ; }
Handles a translation consisting of a single raw text node .