Tabnine Logo
IElementTagStructureHandler.setBody
Code IndexAdd Tabnine to your IDE (free)

How to use
setBody
method
in
org.thymeleaf.processor.element.IElementTagStructureHandler

Best Java code snippets using org.thymeleaf.processor.element.IElementTagStructureHandler.setBody (Showing top 20 results out of 315)

origin: thymeleaf/thymeleaf

structureHandler.setBody(text, false);
origin: thymeleaf/thymeleaf

    return;
  structureHandler.setBody(((Fragment)expressionResult).getTemplateModel(), false);
  return;
  structureHandler.setBody(unescapedTextStr, false);
  return;
  structureHandler.setBody(unescapedTextStr, false);
  return;
structureHandler.setBody(parsedFragment, false);
origin: thymeleaf/thymeleaf

    structureHandler.replaceWith(stringWriter.toString(), false);
  } else {
    structureHandler.setBody(stringWriter.toString(), false);
    structureHandler.replaceWith(model, true);
  } else {
    structureHandler.setBody(model, true);
  structureHandler.replaceWith(fragmentModel, true);
} else {
  structureHandler.setBody(fragmentModel, true);
origin: jamesagnew/hapi-fhir

String trim = result.trim();
theStructureHandler.setBody(trim, true);
origin: thymeleaf/thymeleaf-extras-springsecurity

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return;
  }
  final Authentication authentication = AuthUtils.getAuthenticationObject(context);
  final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue);
  if (authenticationProperty == null) {
    return;
  }
  structureHandler.setBody(authenticationProperty.toString(), false);
}
origin: org.thymeleaf.extras/thymeleaf-extras-springsecurity3

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return;
  }
  final Authentication authentication = AuthUtils.getAuthenticationObject();
  final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue);
  if (authenticationProperty == null) {
    return;
  }
  structureHandler.setBody(authenticationProperty.toString(), false);
}
origin: org.thymeleaf.extras/thymeleaf-extras-springsecurity4

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return;
  }
  final Authentication authentication = AuthUtils.getAuthenticationObject();
  final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue);
  if (authenticationProperty == null) {
    return;
  }
  structureHandler.setBody(authenticationProperty.toString(), false);
}
origin: org.thymeleaf.extras/thymeleaf-extras-springsecurity5

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return;
  }
  final Authentication authentication = AuthUtils.getAuthenticationObject(context);
  final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue);
  if (authenticationProperty == null) {
    return;
  }
  structureHandler.setBody(authenticationProperty.toString(), false);
}
origin: thymeleaf/thymeleaf-extras-springsecurity

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return;
  }
  final Authentication authentication = AuthUtils.getAuthenticationObject();
  final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue);
  if (authenticationProperty == null) {
    return;
  }
  structureHandler.setBody(authenticationProperty.toString(), false);
}
origin: thymeleaf/thymeleaf-extras-springsecurity

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return;
  }
  final Authentication authentication = AuthUtils.getAuthenticationObject();
  final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue);
  if (authenticationProperty == null) {
    return;
  }
  structureHandler.setBody(authenticationProperty.toString(), false);
}
origin: jpenren/thymeleaf-spring-data-dialect

@Override
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName,
    String attributeValue, IElementTagStructureHandler structureHandler) {
  String attrValue = String.valueOf(attributeValue).trim();
  PaginationDecorator decorator = PaginationDecoratorRegistry.getInstance().getDecorator(attrValue);
  String html = decorator.decorate(tag, context);
  boolean isUlNode = Strings.UL.equalsIgnoreCase(tag.getElementCompleteName());
  if (isUlNode) {
    structureHandler.replaceWith(html, false);
  } else {
    structureHandler.setBody(html, false);
  }
}
origin: io.github.jpenren/thymeleaf-spring-data-dialect

@Override
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName,
    String attributeValue, IElementTagStructureHandler structureHandler) {
  String attrValue = String.valueOf(attributeValue).trim();
  PaginationDecorator decorator = PaginationDecoratorRegistry.getInstance().getDecorator(attrValue);
  String html = decorator.decorate(tag, context);
  boolean isUlNode = Strings.UL.equalsIgnoreCase(tag.getElementCompleteName());
  if (isUlNode) {
    structureHandler.replaceWith(html, false);
  } else {
    structureHandler.setBody(html, false);
  }
}
origin: io.github.jpenren/thymeleaf-spring-data-dialect

@Override
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName,
    String attributeValue, IElementTagStructureHandler structureHandler) {
  Locale locale = context.getLocale();
  loadSelectorValues(locale);
  String selectorStyle = String.valueOf(attributeValue).trim();
  String messageKey = getMessageKey(selectorStyle);
  String options = composeSelectorOptions(selectorStyle, context);
  String message = Messages.getMessage(BUNDLE_NAME, messageKey, locale, options);
  structureHandler.setBody(message, false);
}
origin: jpenren/thymeleaf-spring-data-dialect

@Override
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName,
    String attributeValue, IElementTagStructureHandler structureHandler) {
  Locale locale = context.getLocale();
  loadSelectorValues(locale);
  String selectorStyle = String.valueOf(attributeValue).trim();
  String messageKey = getMessageKey(selectorStyle);
  String options = composeSelectorOptions(selectorStyle, context);
  String message = Messages.getMessage(BUNDLE_NAME, messageKey, locale, options);
  structureHandler.setBody(message, false);
}
origin: thymeleaf/thymeleaf-spring

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final BindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
  if (bindStatus.isError()) {
    final StringBuilder strBuilder = new StringBuilder();
    final String[] errorMsgs = bindStatus.getErrorMessages();
    for (int i = 0; i < errorMsgs.length; i++) {
      if (i > 0) {
        strBuilder.append(ERROR_DELIMITER);
      }
      final String displayString = ValueFormatterWrapper.getDisplayString(errorMsgs[i], false);
      strBuilder.append(displayString);
    }
    structureHandler.setBody(strBuilder.toString(), false);
    // Just in case we also have a th:errorclass in this tag
    structureHandler.setLocalVariable(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, bindStatus);
  } else {
    structureHandler.removeElement();
  }
}
origin: org.thymeleaf/thymeleaf-spring4

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final BindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
  if (bindStatus.isError()) {
    final StringBuilder strBuilder = new StringBuilder();
    final String[] errorMsgs = bindStatus.getErrorMessages();
    for (int i = 0; i < errorMsgs.length; i++) {
      if (i > 0) {
        strBuilder.append(ERROR_DELIMITER);
      }
      final String displayString = ValueFormatterWrapper.getDisplayString(errorMsgs[i], false);
      strBuilder.append(displayString);
    }
    structureHandler.setBody(strBuilder.toString(), false);
    // Just in case we also have a th:errorclass in this tag
    structureHandler.setLocalVariable(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, bindStatus);
  } else {
    structureHandler.removeElement();
  }
}
origin: thymeleaf/thymeleaf-spring

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
  if (bindStatus.isError()) {
    final StringBuilder strBuilder = new StringBuilder();
    final String[] errorMsgs = bindStatus.getErrorMessages();
    for (int i = 0; i < errorMsgs.length; i++) {
      if (i > 0) {
        strBuilder.append(ERROR_DELIMITER);
      }
      final String displayString = SpringValueFormatter.getDisplayString(errorMsgs[i], false);
      strBuilder.append(displayString);
    }
    structureHandler.setBody(strBuilder.toString(), false);
    // Just in case we also have a th:errorclass in this tag
    structureHandler.setLocalVariable(SpringContextVariableNames.THYMELEAF_FIELD_BIND_STATUS, bindStatus);
  } else {
    structureHandler.removeElement();
  }
}
origin: thymeleaf/thymeleaf-spring

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final BindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
  if (bindStatus.isError()) {
    final StringBuilder strBuilder = new StringBuilder();
    final String[] errorMsgs = bindStatus.getErrorMessages();
    for (int i = 0; i < errorMsgs.length; i++) {
      if (i > 0) {
        strBuilder.append(ERROR_DELIMITER);
      }
      final String displayString = ValueFormatterWrapper.getDisplayString(errorMsgs[i], false);
      strBuilder.append(HtmlEscape.escapeHtml4Xml(displayString));
    }
    structureHandler.setBody(strBuilder.toString(), false);
    // Just in case we also have a th:errorclass in this tag
    structureHandler.setLocalVariable(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, bindStatus);
  } else {
    structureHandler.removeElement();
  }
}
origin: thymeleaf/thymeleaf-spring

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);
  if (bindStatus.isError()) {
    final StringBuilder strBuilder = new StringBuilder();
    final String[] errorMsgs = bindStatus.getErrorMessages();
    for (int i = 0; i < errorMsgs.length; i++) {
      if (i > 0) {
        strBuilder.append(ERROR_DELIMITER);
      }
      final String displayString = SpringValueFormatter.getDisplayString(errorMsgs[i], false);
      strBuilder.append(HtmlEscape.escapeHtml4Xml(displayString));
    }
    structureHandler.setBody(strBuilder.toString(), false);
    // Just in case we also have a th:errorclass in this tag
    structureHandler.setLocalVariable(SpringContextVariableNames.THYMELEAF_FIELD_BIND_STATUS, bindStatus);
  } else {
    structureHandler.removeElement();
  }
}
origin: io.github.jpenren/thymeleaf-spring-data-dialect

@Override
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName,
    String attributeValue, IElementTagStructureHandler structureHandler) {
  // Compose message with parameters:
  // {0} first reg. position
  // {1} latest page reg. position
  // {2} total elements
  // pagination.summary=Showing {0} to {1} of {2} entries
  Locale locale = context.getLocale();
  Page<?> page = PageUtils.findPage(context);
  int firstItem = PageUtils.getFirstItemInPage(page);
  int latestItem = PageUtils.getLatestItemInPage(page);
  int totalElements = (int) page.getTotalElements();
  boolean isEmpty = page.getTotalElements() == 0;
  String attrValue = String.valueOf(attributeValue).trim();
  String messageTemplate = COMPACT.equals(attrValue) ? COMPACT_MESSAGE_KEY : DEFAULT_MESSAGE_KEY;
  String messageKey = isEmpty ? NO_VALUES_MESSAGE_KEY : messageTemplate;
  String message = Messages.getMessage(BUNDLE_NAME, messageKey, locale, firstItem, latestItem, totalElements);
  structureHandler.setBody(message, false);
}
org.thymeleaf.processor.elementIElementTagStructureHandlersetBody

Javadoc

Instructs the engine to set a new body for the current element, in the form of a CharSequence.

This is the way a processor can change what is shown inside an element during processing. For example, it is this way how th:text changes the contents of its containing element.

Popular methods of IElementTagStructureHandler

  • removeAttribute
  • removeElement
  • setAttribute
  • replaceWith
  • setLocalVariable
  • insertBefore
  • insertImmediatelyAfter
  • replaceAttribute
  • removeTags
  • iterateElement
    Instructs the engine to iterate the current element, applying a specific iteration configuration.
  • removeAllButFirstChild
    Instructs the engine to remove all the children of the element being processed, except the first on
  • removeBody
    Instructs the engine to remove the body of the element being processed, but keep the open and close
  • removeAllButFirstChild,
  • removeBody,
  • setInliner,
  • setSelectionTarget,
  • setTemplateData

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JButton (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now