Tabnine Logo
org.thymeleaf.processor.element
Code IndexAdd Tabnine to your IDE (free)

How to use org.thymeleaf.processor.element

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

origin: thymeleaf/thymeleaf

@Override
protected void doProcess(final ITemplateContext context,
             final IProcessableElementTag tag,
             final IElementTagStructureHandler structureHandler) {
  // We are just removing the "<th:block>", leaving whichever contents (body) it might have generated.
  structureHandler.removeTags();
}
origin: thymeleaf/thymeleaf

public void process(final ITemplateContext context, final IProcessableElementTag tag, final IElementTagStructureHandler structureHandler) {
  this.processor.process(context, tag, structureHandler);
}
origin: thymeleaf/thymeleaf

public final MatchingAttributeName getMatchingAttributeName() {
  return this.processor.getMatchingAttributeName();
}
origin: thymeleaf/thymeleaf

@Override
protected void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final IElementTagStructureHandler structureHandler) {
  // Nothing to do, this processor is just a marker. Simply remove the attribute
  final AttributeName attributeName = getMatchingAttributeName().getMatchingAttributeName();
  structureHandler.removeAttribute(attributeName);
}
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

public static void setAttribute(
    final IElementTagStructureHandler structureHandler,
    final AttributeDefinition attributeDefinition, final String attributeName, final String attributeValue) {
  if (structureHandler instanceof ElementTagStructureHandler) {
    ((ElementTagStructureHandler) structureHandler).setAttribute(attributeDefinition, attributeName, attributeValue, null);
  } else {
    structureHandler.setAttribute(attributeName, attributeValue);
  }
}
origin: thymeleaf/thymeleaf

@Override
protected final void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final boolean visible = isVisible(context, tag, attributeName, attributeValue);
  if (!visible) {
    structureHandler.removeElement();
  }
}
origin: thymeleaf/thymeleaf

@Override
protected void doProcess(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration());
  final IStandardExpression switchExpression =
      expressionParser.parseExpression(context, attributeValue);
  structureHandler.setLocalVariable(SWITCH_VARIABLE_NAME, new SwitchStructure(switchExpression));
}
origin: thymeleaf/thymeleaf

public StandardDefaultAttributesTagProcessor(final TemplateMode templateMode, final String dialectPrefix) {
  super(templateMode, PRECEDENCE);
  this.dialectPrefix = dialectPrefix;
  this.matchingAttributeName = MatchingAttributeName.forAllAttributesWithPrefix(getTemplateMode(), dialectPrefix);
}
origin: thymeleaf/thymeleaf

public static void replaceAttribute(
    final IElementTagStructureHandler structureHandler,
    final AttributeName oldAttributeName,
    final AttributeDefinition attributeDefinition, final String attributeName, final String attributeValue) {
  if (structureHandler instanceof ElementTagStructureHandler) {
    ((ElementTagStructureHandler) structureHandler).replaceAttribute(oldAttributeName, attributeDefinition, attributeName, attributeValue, null);
  } else {
    structureHandler.replaceAttribute(oldAttributeName, attributeName, attributeValue);
  }
}
origin: thymeleaf/thymeleaf

public AbstractElementModelProcessor(
    final TemplateMode templateMode, final String dialectPrefix,
    final String elementName, final boolean prefixElementName,
    final String attributeName, final boolean prefixAttributeName,
    final int precedence) {
  super(templateMode, precedence);
  this.dialectPrefix = dialectPrefix;
  this.matchingElementName =
      (elementName == null?
        null :
        MatchingElementName.forElementName(
            templateMode, ElementNames.forName(templateMode, (prefixElementName? this.dialectPrefix : null), elementName)));
  this.matchingAttributeName =
      (attributeName == null?
        null :
        MatchingAttributeName.forAttributeName(
            templateMode, AttributeNames.forName(templateMode, (prefixAttributeName? this.dialectPrefix : null), attributeName)));
}
origin: thymeleaf/thymeleaf

public static MatchingAttributeName forAllAttributesWithPrefix(final TemplateMode templateMode, final String matchingAllAttributesWithPrefix) {
  Validate.notNull(templateMode, "Template mode cannot be null");
  // Prefix can actually be null -> match all attributes with no prefix
  return new MatchingAttributeName(templateMode, null, matchingAllAttributesWithPrefix, false);
}
origin: thymeleaf/thymeleaf

public static MatchingElementName forAllElementsWithPrefix(final TemplateMode templateMode, final String matchingAllElementsWithPrefix) {
  Validate.notNull(templateMode, "Template mode cannot be null");
  // Prefix can actually be null -> match all elements with no prefix
  return new MatchingElementName(templateMode, null, matchingAllElementsWithPrefix, false);
}
origin: thymeleaf/thymeleaf

public void process(final ITemplateContext context, final IModel model, final IElementModelStructureHandler structureHandler) {
  this.processor.process(context, model, structureHandler);
}
origin: thymeleaf/thymeleaf

public final MatchingElementName getMatchingElementName() {
  return this.processor.getMatchingElementName();
}
origin: thymeleaf/thymeleaf

@Override
protected final void doProcess(
    final ITemplateContext context,
    final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue,
    final IElementTagStructureHandler structureHandler) {
  // Note we are NOT executing the attributeValue as a Standard Expression: we are expecting a literal (see comment above)
  final IInliner inliner = getInliner(context, StandardInlineMode.parse(attributeValue));
  structureHandler.setInliner(inliner);
}
origin: thymeleaf/thymeleaf

public AbstractElementTagProcessor(
    final TemplateMode templateMode, final String dialectPrefix,
    final String elementName, final boolean prefixElementName,
    final String attributeName, final boolean prefixAttributeName,
    final int precedence) {
  super(templateMode, precedence);
  this.dialectPrefix = dialectPrefix;
  this.matchingElementName =
      (elementName == null?
        null :
        MatchingElementName.forElementName(
            templateMode, ElementNames.forName(templateMode, (prefixElementName? this.dialectPrefix : null), elementName)));
  this.matchingAttributeName =
      (attributeName == null?
        null :
        MatchingAttributeName.forAttributeName(
            templateMode, AttributeNames.forName(templateMode, (prefixAttributeName? this.dialectPrefix : null), attributeName)));
}
origin: thymeleaf/thymeleaf

public static MatchingAttributeName forAllAttributes(final TemplateMode templateMode) {
  Validate.notNull(templateMode, "Template mode cannot be null");
  return new MatchingAttributeName(templateMode, null, null, true);
}
origin: thymeleaf/thymeleaf

public static MatchingElementName forAllElements(final TemplateMode templateMode) {
  Validate.notNull(templateMode, "Template mode cannot be null");
  return new MatchingElementName(templateMode, null, null, true);
}
origin: thymeleaf/thymeleaf

public static MatchingAttributeName forAttributeName(final TemplateMode templateMode, final AttributeName matchingAttributeName) {
  Validate.notNull(templateMode, "Template mode cannot be null");
  Validate.notNull(matchingAttributeName, "Matching attribute name cannot be null");
  if (templateMode == TemplateMode.HTML && !(matchingAttributeName instanceof HTMLAttributeName)) {
    throw new IllegalArgumentException("Attribute names for HTML template mode must be of class " + HTMLAttributeName.class.getName());
  } else if (templateMode == TemplateMode.XML && !(matchingAttributeName instanceof XMLAttributeName)) {
    throw new IllegalArgumentException("Attribute names for XML template mode must be of class " + XMLAttributeName.class.getName());
  } else if (templateMode.isText() && !(matchingAttributeName instanceof TextAttributeName)) {
    throw new IllegalArgumentException("Attribute names for any text template modes must be of class " + TextAttributeName.class.getName());
  }
  return new MatchingAttributeName(templateMode, matchingAttributeName, null, false);
}
org.thymeleaf.processor.element

Most used classes

  • IElementTagStructureHandler
  • MatchingAttributeName
  • AbstractAttributeModelProcessor
  • AbstractAttributeTagProcessor
  • AbstractConditionalVisibilityElementProcessor
  • AbstractElementProcessor,
  • AbstractElementTagProcessor,
  • AbstractFragmentHandlingElementProcessor,
  • AbstractIterationElementProcessor$IterationSpec,
  • AbstractIterationElementProcessor$StatusVar,
  • AbstractIterationElementProcessor,
  • AbstractLocalVariableDefinitionElementProcessor,
  • AbstractMarkupSubstitutionElementProcessor,
  • AbstractNoOpElementProcessor,
  • AbstractRemovalElementProcessor,
  • AbstractSelectionTargetElementProcessor,
  • AbstractTextChildModifierElementProcessor,
  • AbstractUnescapedTextChildModifierElementProcessor,
  • IElementModelProcessor
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