Package nu.validator.htmlparser.impl

Examples of nu.validator.htmlparser.impl.ErrorReportingTokenizer


     *            the DOM implementation
     *            @param xmlPolicy the policy
     */
    public HtmlParser(JavaScriptObject document) {
        this.domTreeBuilder = new BrowserTreeBuilder(document);
        this.tokenizer = new ErrorReportingTokenizer(domTreeBuilder);
        this.domTreeBuilder.setNamePolicy(XmlViolationPolicy.ALTER_INFOSET);
        this.tokenizer.setCommentPolicy(XmlViolationPolicy.ALTER_INFOSET);
        this.tokenizer.setContentNonXmlCharPolicy(XmlViolationPolicy.ALTER_INFOSET);
        this.tokenizer.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
        this.tokenizer.setNamePolicy(XmlViolationPolicy.ALTER_INFOSET);
View Full Code Here


     */
    public HtmlParser(JavaScriptObject document) {
        this.domTreeBuilder = new BrowserTreeBuilder(document);

    // updated here
        this.tokenizer = new ErrorReportingTokenizer(domTreeBuilder);
    // ^
        this.domTreeBuilder.setNamePolicy(XmlViolationPolicy.ALTER_INFOSET);
        this.tokenizer.setCommentPolicy(XmlViolationPolicy.ALTER_INFOSET);
        this.tokenizer.setContentNonXmlCharPolicy(XmlViolationPolicy.ALTER_INFOSET);
        this.tokenizer.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
View Full Code Here

    private Tokenizer newTokenizer(TokenHandler handler, boolean newAttributesEachTime) {
        if (errorHandler == null && transitionHandler == null &&
            contentNonXmlCharPolicy == XmlViolationPolicy.ALLOW) {
            return new Tokenizer(handler, newAttributesEachTime);
        }
        ErrorReportingTokenizer tokenizer =
            new ErrorReportingTokenizer(handler, newAttributesEachTime);
        tokenizer.setErrorProfile(errorProfileMap);
        return tokenizer;
   }
View Full Code Here

            boolean newAttributesEachTime) {
        if (errorHandler == null && transitionHandler == null
                && contentNonXmlCharPolicy == XmlViolationPolicy.ALLOW) {
            return new Tokenizer(handler, newAttributesEachTime);
        } else {
            return new ErrorReportingTokenizer(handler, newAttributesEachTime);
        }
    }
View Full Code Here

    private Tokenizer newTokenizer(TokenHandler handler, boolean newAttributesEachTime) {
        if (errorHandler == null && transitionHandler == null
                && contentNonXmlCharPolicy == XmlViolationPolicy.ALLOW) {
            return new Tokenizer(handler, newAttributesEachTime);
        } else {
            return new ErrorReportingTokenizer(handler, newAttributesEachTime);
        }
   }
View Full Code Here

    private Tokenizer newTokenizer(TokenHandler handler, boolean newAttributesEachTime) {
        if (errorHandler == null && transitionHandler == null
                && contentNonXmlCharPolicy == XmlViolationPolicy.ALLOW) {
            return new Tokenizer(handler, newAttributesEachTime);
        } else {
            return new ErrorReportingTokenizer(handler, newAttributesEachTime);
        }
   }
View Full Code Here

        }
    }
   
    public void setTransitionHandler(TransitionHandler transitionHandler) {
        if (tokenizer instanceof ErrorReportingTokenizer) {
            ErrorReportingTokenizer ert = (ErrorReportingTokenizer) tokenizer;
            ert.setTransitionHandler(transitionHandler);
        } else if (transitionHandler != null) {
            throw new IllegalStateException("Attempt to set a transition handler on a plain tokenizer.");
        }
    }
View Full Code Here

        }
    }
   
    public void setTransitionHandler(TransitionHandler transitionHandler) {
        if (tokenizer instanceof ErrorReportingTokenizer) {
            ErrorReportingTokenizer ert = (ErrorReportingTokenizer) tokenizer;
            ert.setTransitionHandler(transitionHandler);
        } else if (transitionHandler != null) {
            throw new IllegalStateException("Attempt to set a transition handler on a plain tokenizer.");
        }
    }
View Full Code Here

    private Tokenizer newTokenizer(TokenHandler handler, boolean newAttributesEachTime) {
        if (errorHandler == null && transitionHandler == null
                && contentNonXmlCharPolicy == XmlViolationPolicy.ALLOW) {
            return new Tokenizer(handler, newAttributesEachTime);
        } else {
            return new ErrorReportingTokenizer(handler, newAttributesEachTime);
        }
   }
View Full Code Here

            boolean newAttributesEachTime) {
        if (errorHandler == null && transitionHandler == null
                && contentNonXmlCharPolicy == XmlViolationPolicy.ALLOW) {
            return new Tokenizer(handler, newAttributesEachTime);
        } else {
            return new ErrorReportingTokenizer(handler, newAttributesEachTime);
        }
    }
View Full Code Here

TOP

Related Classes of nu.validator.htmlparser.impl.ErrorReportingTokenizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.