class SpringOptionInSelectFieldTagProcessor extends AbstractElementTagProcessor {


    // This is 1005 in order to make sure it is executed just before "value" (Spring's version) and especially "th:field"
    public static final int ATTR_PRECEDENCE = 1005;
    public static final String OPTION_TAG_NAME = "option";



    public SpringOptionInSelectFieldTagProcessor(final String dialectPrefix) {
        super(TemplateMode.HTML, dialectPrefix, OPTION_TAG_NAME, false, null, false, ATTR_PRECEDENCE);
    }




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



}


        final AttributeName selectAttrNameToAdd =
                (AttributeName) context.getVariable(SpringSelectFieldTagProcessor.OPTION_IN_SELECT_ATTR_NAME);
        if (selectAttrNameToAdd == null) {
            // Nothing to do
            return;
        }

        // It seems this <option> is inside a <select th:field="...">, and the processor for that "th:field" has left
        // as a local variable the name and value of the attribute to be added

        final String selectAttrValueToAdd =
                (String) context.getVariable(SpringSelectFieldTagProcessor.OPTION_IN_SELECT_ATTR_VALUE);

        if (tag.hasAttribute(selectAttrNameToAdd)) {
            if (!selectAttrValueToAdd.equals(tag.getAttributeValue(selectAttrNameToAdd))) {
                throw new TemplateProcessingException(
                        "If specified (which is not required), attribute \"" + selectAttrNameToAdd + "\" in " +
                        "\"option\" tag must have exactly the same value as in its containing \"select\" tag");
            }
        }

        // This attribute value does not need to be escaped, because we are just "transporting" the th:field in the
        // container <select> to its <option>'s, without any modifications. It will be executed (and its results
        // escaped) later...
        structureHandler.setAttribute(selectAttrNameToAdd.getCompleteAttributeNames()[0], selectAttrValueToAdd);

    
<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