PlainTextContent { public void setExpression(String expression) { if (contentControl.getSdtPr() == null) { SdtPr sdtPr = wFactory.createSdtPr(); contentControl.setSdtPr(sdtPr); } if (contentControl.getSdtPr().getTag() == null) { Tag tag = wFactory.createTag(); contentControl.getSdtPr().setTag(tag); } contentControl.getSdtPr().getTag().setVal(expression); } PlainTextContent(SdtElement sdtElement); static SdtBlock createSdtBlockElement(); String getExpression(); void setExpression(String expression); boolean hasExpression(); void setTitle(String value); void setPlaceHolderContent(String text); void setContent(String value); void hideMarkers(); void showMarkgers(); static boolean isPlainTextContent(SdtElement element);  }
@Test public void testSetExpression() throws Exception { SdtElement element = createPlainTextContentControl(SdtBlock.class); PlainTextContent plainTextContent = new PlainTextContent(element); plainTextContent.setExpression("expression"); String xmlString = XmlUtils.marshaltoString( plainTextContent.getXmlElement(), true); assertTrue(xmlString.contains("<w:tag w:val=\"expression\"/>")); }