AttributeDefinition
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.thymeleaf.engine.AttributeDefinition (Showing top 20 results out of 315)

origin: thymeleaf/thymeleaf

public final String toString() {
  return getAttributeName().toString();
}
origin: thymeleaf/thymeleaf

@Override
protected final void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final Object expressionResult,
    final IElementTagStructureHandler structureHandler) {
  final String newAttributeValue =
      EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
  // These attributes might be "removable if empty", in which case we would simply remove the target attributes...
  if (this.removeIfEmpty && (newAttributeValue == null || newAttributeValue.length() == 0)) {
    // We are removing the equivalent attribute name, without the prefix...
    structureHandler.removeAttribute(this.attributeOneDefinition.getAttributeName());
    structureHandler.removeAttribute(this.attributeTwoDefinition.getAttributeName());
  } else {
    // We are setting the equivalent attribute name, without the prefix...
    StandardProcessorUtils.setAttribute(structureHandler, this.attributeOneDefinition, this.attributeOneCompleteName, newAttributeValue);
    StandardProcessorUtils.setAttribute(structureHandler, this.attributeTwoDefinition, this.attributeTwoCompleteName, newAttributeValue);
  }
}
origin: thymeleaf/thymeleaf

@Override
protected final void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final Object expressionResult,
    final IElementTagStructureHandler structureHandler) {
  if (EvaluationUtils.evaluateAsBoolean(expressionResult)) {
    StandardProcessorUtils.setAttribute(structureHandler, this.targetAttributeDefinition, this.targetAttributeCompleteName, this.targetAttributeCompleteName);
  } else {
    structureHandler.removeAttribute(this.targetAttributeDefinition.getAttributeName());
  }
}
origin: thymeleaf/thymeleaf

@Override
protected final void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final Object expressionResult,
    final IElementTagStructureHandler structureHandler) {
  String newAttributeValue =
      EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
  // If we are not adding anything, we'll just leave it untouched
  if (newAttributeValue != null && newAttributeValue.length() > 0) {
    final AttributeName targetAttributeName = this.targetAttributeDefinition.getAttributeName();
    if (tag.hasAttribute(targetAttributeName)) {
      final String currentValue = tag.getAttributeValue(targetAttributeName);
      if (currentValue.length() > 0) {
        newAttributeValue = currentValue + ' ' + newAttributeValue;
      }
    }
    StandardProcessorUtils.setAttribute(structureHandler, this.targetAttributeDefinition, TARGET_ATTR_NAME, newAttributeValue);
  }
}
origin: thymeleaf/thymeleaf

@Override
protected final void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final Object expressionResult,
    final IElementTagStructureHandler structureHandler) {
  String newAttributeValue =
      EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
  // If we are not adding anything, we'll just leave it untouched
  if (newAttributeValue != null && newAttributeValue.length() > 0) {
    final AttributeName targetAttributeName = this.targetAttributeDefinition.getAttributeName();
    if (tag.hasAttribute(targetAttributeName)) {
      final String currentValue = tag.getAttributeValue(targetAttributeName);
      if (currentValue.length() > 0) {
        newAttributeValue = currentValue + ' ' + newAttributeValue;
      }
    }
    StandardProcessorUtils.setAttribute(structureHandler, this.targetAttributeDefinition, TARGET_ATTR_NAME, newAttributeValue);
  }
}
origin: thymeleaf/thymeleaf

protected void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final Object expressionResult,
    final IElementTagStructureHandler structureHandler) {
  final String newAttributeValue =
      EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
  // These attributes are "removable if empty", so we simply remove the target attribute...
  if (newAttributeValue == null || newAttributeValue.length() == 0) {
    // We are removing the equivalent attribute name, without the prefix...
    structureHandler.removeAttribute(this.targetAttributeDefinition.getAttributeName());
    structureHandler.removeAttribute(attributeName);
  } else {
    // We are setting the equivalent attribute name, without the prefix...
    StandardProcessorUtils.replaceAttribute(
        structureHandler, attributeName, this.targetAttributeDefinition, this.targetAttrCompleteName, (newAttributeValue == null ? "" : newAttributeValue));
  }
}
origin: thymeleaf/thymeleaf

@Override
protected final void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final Object expressionResult,
    final IElementTagStructureHandler structureHandler) {
  final String newAttributeValue =
      EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString());
  // These attributes might be "removable if empty", in which case we would simply remove the target attribute...
  if (this.removeIfEmpty && (newAttributeValue == null || newAttributeValue.length() == 0)) {
    // We are removing the equivalent attribute name, without the prefix...
    structureHandler.removeAttribute(this.targetAttributeDefinition.getAttributeName());
    structureHandler.removeAttribute(attributeName);
  } else {
    // We are setting the equivalent attribute name, without the prefix...
    StandardProcessorUtils.replaceAttribute(
        structureHandler, attributeName, this.targetAttributeDefinition, this.targetAttrCompleteName, (newAttributeValue == null ? "" : newAttributeValue));
  }
}
origin: thymeleaf/thymeleaf

public void process(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final IElementTagStructureHandler structureHandler) {
  final TemplateMode templateMode = getTemplateMode();
  final IAttribute[] attributes = tag.getAllAttributes();
  // Should be no problem in performing modifications during iteration, as the attributeNames list
  // should not be affected by modifications on the original tag attribute set
  for (final IAttribute attribute : attributes) {
    final AttributeName attributeName = attribute.getAttributeDefinition().getAttributeName();
    if (attributeName.isPrefixed()) {
      if (TextUtil.equals(templateMode.isCaseSensitive(), attributeName.getPrefix(), this.dialectPrefix)) {
        // We will process each 'default' attribute separately
        processDefaultAttribute(getTemplateMode(), context, tag, attribute, structureHandler);
      }
    }
  }
}
origin: thymeleaf/thymeleaf

final AttributeName attributeName = attribute.getAttributeDefinition().getAttributeName();
final String attributeValue =
    EscapedAttributeUtils.unescapeAttribute(context.getTemplateMode(), attribute.getValue());
origin: org.thymeleaf/thymeleaf-spring4

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: thymeleaf/thymeleaf-spring

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: org.thymeleaf/thymeleaf-spring4

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: org.thymeleaf/thymeleaf-spring3

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: thymeleaf/thymeleaf-spring

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: thymeleaf/thymeleaf-spring

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: thymeleaf/thymeleaf-spring

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: thymeleaf/thymeleaf-spring

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: thymeleaf/thymeleaf-spring

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: org.thymeleaf/thymeleaf-spring3

private final boolean isDisabled(final IProcessableElementTag tag) {
  // Disabled = attribute "disabled" exists
  return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName());
}
origin: thymeleaf/thymeleaf-spring

private boolean matchesDiscriminator(final IProcessableElementTag tag) {
  if (this.discriminatorAttrName == null) {
    return true;
  }
  final boolean hasDiscriminatorAttr = tag.hasAttribute(this.discriminatorAttributeDefinition.getAttributeName());
  if (this.discriminatorAttrValues == null || this.discriminatorAttrValues.length == 0) {
    return hasDiscriminatorAttr;
  }
  final String discriminatorTagValue =
      (hasDiscriminatorAttr? tag.getAttributeValue(this.discriminatorAttributeDefinition.getAttributeName()) : null);
  for (int i = 0; i < this.discriminatorAttrValues.length; i++) {
    final String discriminatorAttrValue = this.discriminatorAttrValues[i];
    if (discriminatorAttrValue == null) {
      if (!hasDiscriminatorAttr || discriminatorTagValue == null) {
        return true;
      }
    } else if (discriminatorAttrValue.equals(discriminatorTagValue)) {
      return true;
    }
  }
  return false;
}
org.thymeleaf.engineAttributeDefinition

Most used methods

  • getAttributeName

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • requestLocationUpdates (LocationManager)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Collectors (java.util.stream)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)