All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gg.jte.html.policy.PreventInvalidAttributeNames Maven / Gradle / Ivy

There is a newer version: 3.1.12
Show newest version
package gg.jte.html.policy;

import gg.jte.html.HtmlAttribute;
import gg.jte.html.HtmlPolicy;
import gg.jte.html.HtmlPolicyException;
import gg.jte.html.HtmlTag;

public class PreventInvalidAttributeNames implements HtmlPolicy {

    @Override
    public void validateHtmlTag(HtmlTag htmlTag) throws HtmlPolicyException {
    }

    @Override
    public void validateHtmlAttribute(HtmlTag htmlTag, HtmlAttribute htmlAttribute) throws HtmlPolicyException {
        if ( htmlAttribute.getName().contains(";") ) {
            throw new HtmlPolicyException("Invalid HTML attribute name " + htmlAttribute.getName() + "!");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy