@Override protected void visitMsgNode(MsgNode node) { MsgPartsAndIds msgPartsAndIds = MsgUtils.buildMsgPartsAndComputeMsgIdForDualFormat(node); SoyMsg.Builder builder = SoyMsg.builder().setId(msgPartsAndIds.id); if (node.getMeaning() != null) { builder.setMeaning(node.getMeaning()); } SoyMsg msg = builder .setDesc(node.getDesc()) .setIsHidden(node.isHidden()) .setContentType(node.getContentType()) .addSourceLocation(node.getSourceLocation()) .setIsPlrselMsg(node.isPlrselMsg()) .setParts(msgPartsAndIds.parts) .build(); msgs.add(msg); }
@Override protected void visitMsgNode(MsgNode node) { MsgPartsAndIds msgPartsAndIds = MsgUtils.buildMsgPartsAndComputeMsgIdForDualFormat(node); SoyMsg.Builder builder = SoyMsg.builder().setId(msgPartsAndIds.id); if (node.getMeaning() != null) { builder.setMeaning(node.getMeaning()); } SoyMsg msg = builder .setDesc(node.getDesc()) .setIsHidden(node.isHidden()) .setContentType(node.getContentType()) .setSourceLocation(node.getSourceLocation()) .setIsPlrselMsg(node.isPlrselMsg()) .setParts(msgPartsAndIds.parts) .build(); msgs.add(msg); }
/** Creates a new {@link Builder} based on the current instance. */ Builder toBuilder() { Builder builder = builder() .setId(getId()) .setIsHidden(isHidden()) .setParts(getParts()) .addAllSourceLocations(getSourceLocations()) .setIsPlrselMsg(isPlrselMsg()); if (getLocaleString() != null) { builder.setLocaleString(getLocaleString()); } if (getMeaning() != null) { builder.setMeaning(getMeaning()); } if (getDesc() != null) { builder.setDesc(getDesc()); } if (getAltId() != -1) { builder.setAltId(getAltId()); } if (getContentType() != null) { builder.setContentType(getContentType()); } return builder; }