class AbstractAttributeTagProcessor extends AbstractElementTagProcessor {


    private final boolean removeAttribute;


    protected AbstractAttributeTagProcessor(
            final TemplateMode templateMode, final String dialectPrefix,
            final String elementName, final boolean prefixElementName,
            final String attributeName, final boolean prefixAttributeName,
            final int precedence, final boolean removeAttribute) {
        super(templateMode, dialectPrefix, elementName, prefixElementName, attributeName, prefixAttributeName, precedence);
        Validate.notEmpty(attributeName, "Attribute name cannot be null or empty in Attribute Tag Processor");
        this.removeAttribute = removeAttribute;
    }



    @Override
    protected final void doProcess(
            final ITemplateContext context,
            final IProcessableElementTag tag,
            final IElementTagStructureHandler structureHandler) {<FILL_FUNCTION_BODY>}


    protected abstract void doProcess(
            final ITemplateContext context,
            final IProcessableElementTag tag,
            final AttributeName attributeName,
            final String attributeValue,
            final IElementTagStructureHandler structureHandler);



}


        AttributeName attributeName = null;
        try {

            attributeName = getMatchingAttributeName().getMatchingAttributeName();

            final String attributeValue =
                    EscapedAttributeUtils.unescapeAttribute(context.getTemplateMode(), tag.getAttributeValue(attributeName));

            doProcess(
                    context, tag,
                    attributeName, attributeValue,
                    structureHandler);

            if (this.removeAttribute) {
                structureHandler.removeAttribute(attributeName);
            }

        } catch (final TemplateProcessingException e) {
            // This is a nice moment to check whether the execution raised an error and, if so, add location information
            // Note this is similar to what is done at the superclass AbstractElementTagProcessor, but we can be more
            // specific because we know exactly what attribute was being executed and caused the error
            if (tag.hasLocation()) {
                if (!e.hasTemplateName()) {
                    e.setTemplateName(tag.getTemplateName());
                }
                if (!e.hasLineAndCol()) {
                    if (attributeName == null) {
                        // We don't have info about the specific attribute provoking the error
                        e.setLineAndCol(tag.getLine(), tag.getCol());
                    } else {
                        final IAttribute attribute = tag.getAttribute(attributeName);
                        if (attribute != null) {
                            e.setLineAndCol(attribute.getLine(), attribute.getCol());
                        }
                    }
                }
            }
            throw e;
        } catch (final Exception e) {
            int line = tag.getLine();
            int col = tag.getCol();
            if (attributeName != null) {
                // We don't have info about the specific attribute provoking the error
                final IAttribute attribute = tag.getAttribute(attributeName);
                if (attribute != null) {
                    line = attribute.getLine();
                    col = attribute.getCol();
                }
            }
            throw new TemplateProcessingException(
                    "Error during execution of processor '" + this.getClass().getName() + "'",
                    tag.getTemplateName(), line, col, e);
        }

    
<methods>public void <init>(org.thymeleaf.templatemode.TemplateMode, java.lang.String, java.lang.String, boolean, java.lang.String, boolean, int) ,public final org.thymeleaf.processor.element.MatchingAttributeName getMatchingAttributeName() ,public final org.thymeleaf.processor.element.MatchingElementName getMatchingElementName() ,public final void process(org.thymeleaf.context.ITemplateContext, org.thymeleaf.model.IProcessableElementTag, org.thymeleaf.processor.element.IElementTagStructureHandler) <variables>private final non-sealed java.lang.String dialectPrefix,private final non-sealed org.thymeleaf.processor.element.MatchingAttributeName matchingAttributeName,private final non-sealed org.thymeleaf.processor.element.MatchingElementName matchingElementName