예제 #1
0
 @NotNull
 public String getText() {
   String text = myText;
   if (text != null) return text;
   final StringBuilder consolidatedText = new StringBuilder();
   for (final XmlTagChild element : myElements) {
     consolidatedText.append(element.getText());
   }
   return myText = consolidatedText.toString();
 }
예제 #2
0
  @NotNull
  public String getTrimmedText() {
    String trimmedText = myTrimmedText;
    if (trimmedText != null) return trimmedText;

    final StringBuilder consolidatedText = new StringBuilder();
    final XmlText[] textElements = getTextElements();
    for (final XmlText textElement : textElements) {
      consolidatedText.append(textElement.getValue());
    }
    return myTrimmedText = consolidatedText.toString().trim();
  }