PlainTextContent { public boolean hasExpression() { return contentControl.getSdtPr() != null && contentControl.getSdtPr().getTag() != null && StringUtils.isNotEmpty(contentControl.getSdtPr().getTag() .getVal()); } 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 testhasExpression() throws Exception { SdtElement element = createPlainTextContentControl(SdtBlock.class); Tag tag = new Tag(); tag.setVal("tag"); element.getSdtPr().setTag(tag); PlainTextContent plainTextContent = new PlainTextContent(element); assertTrue(plainTextContent.hasExpression()); }
@Test() public void testhasNoExpression() throws Exception { SdtElement element = createPlainTextContentControl(SdtBlock.class); Tag tag = new Tag(); element.getSdtPr().setTag(tag); PlainTextContent plainTextContent = new PlainTextContent(element); assertFalse(plainTextContent.hasExpression()); }