Package org.whattf.datatype

Examples of org.whattf.datatype.Html5DatatypeException


    private void elaborateDatatypes(Map<String, DatatypeException> map) throws SAXException {
        Set<DocumentFragment> fragments = new HashSet<DocumentFragment>();
        for (Map.Entry<String, DatatypeException> entry : map.entrySet()) {
            DatatypeException ex = entry.getValue();
            if (ex instanceof Html5DatatypeException) {
                Html5DatatypeException ex5 = (Html5DatatypeException) ex;
                DocumentFragment fragment = HTML5_DATATYPE_ADVICE.get(ex5.getDatatypeClass());
                if (fragment != null) {
                    fragments.add(fragment);
                }
            }
        }
View Full Code Here


                        }
                    } else if ("script".equals(localName)) {
                        // need cast to Html5DatatypeException in order to check
                        // what HTML5 datatype class this exception of for
                        assert e instanceof Html5DatatypeException : "Not an Html5DatatypeException";
                        Html5DatatypeException ex5 = (Html5DatatypeException) e;
                        if (Script.class.equals(ex5.getDatatypeClass())) {
                            try {
                                errBadTextContent(e, Script.class, localName,
                                        uri);
                            } catch (ClassNotFoundException ce) {
                                throw new RuntimeException(e);
View Full Code Here

    private void errBadTextContent(DatatypeException e, Class<?> datatypeClass,
            String localName, String uri) throws SAXException,
            ClassNotFoundException {
        if (getErrorHandler() != null) {
            Html5DatatypeException ex5 = (Html5DatatypeException) e;
            boolean warning = ex5.isWarning() ? true : false;
            DatatypeMismatchException dme = new DatatypeMismatchException(
                    "The text content of element \u201c" + localName
                            // + "\u201D from namespace \u201C" + uri
                            + "\u201d was not in the required format: "
                            + e.getMessage().split(": ")[1],
View Full Code Here

          BadAttributeValueException ex = (BadAttributeValueException) e;
          Map<String, DatatypeException> datatypeErrors = ex.getExceptions();
          for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
            DatatypeException dex = entry.getValue();
            if (dex instanceof Html5DatatypeException) {
              Html5DatatypeException ex5 = (Html5DatatypeException) dex;
              if (ex5.isWarning()) {
                this.warnings++;
                throwIfTooManyMessages();
                messageFromSAXParseException(MessageType.WARNING, e, exact);
                return;
              }
            }
          }
        }
        if (e instanceof DatatypeMismatchException) {
          DatatypeMismatchException ex = (DatatypeMismatchException) e;
          Map<String, DatatypeException> datatypeErrors = ex.getExceptions();
          for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
            DatatypeException dex = entry.getValue();
            if (dex instanceof Html5DatatypeException) {
              Html5DatatypeException ex5 = (Html5DatatypeException) dex;
              if (ex5.isWarning()) {
                this.warnings++;
                throwIfTooManyMessages();
                messageFromSAXParseException(MessageType.WARNING, e, exact);
                return;
              }
View Full Code Here

            messageTextString(messageTextHandler, COLON, false);                   
            for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
                messageTextString(messageTextHandler, SPACE, false);
                DatatypeException ex = entry.getValue();
                if (ex instanceof Html5DatatypeException) {
                    Html5DatatypeException ex5 = (Html5DatatypeException) ex;
                    String[] segments = ex5.getSegments();
                    for (int i = 0; i < segments.length; i++) {
                        String segment = segments[i];
                        if (i % 2 == 0) {
                            emitStringWithQurlyQuotes(messageTextHandler, segment);                           
                        } else {
View Full Code Here

    private void elaborateDatatypes(Map<String, DatatypeException> map) throws SAXException {
        Set<DocumentFragment> fragments = new HashSet<DocumentFragment>();
        for (Map.Entry<String, DatatypeException> entry : map.entrySet()) {
            DatatypeException ex = entry.getValue();
            if (ex instanceof Html5DatatypeException) {
                Html5DatatypeException ex5 = (Html5DatatypeException) ex;
                DocumentFragment fragment = HTML5_DATATYPE_ADVICE.get(ex5.getDatatypeClass());
                if (fragment != null) {
                    fragments.add(fragment);
                }
            }
        }
View Full Code Here

                        }
                    } else if ("script".equals(localName)) {
                        // need cast to Html5DatatypeException in order to check
                        // what HTML5 datatype class this exception of for
                        assert e instanceof Html5DatatypeException : "Not an Html5DatatypeException";
                        Html5DatatypeException ex5 = (Html5DatatypeException) e;
                        if (Script.class.equals(ex5.getDatatypeClass())) {
                            try {
                                errBadTextContent(e, Script.class, localName,
                                        uri);
                            } catch (ClassNotFoundException ce) {
                                throw new RuntimeException(e);
View Full Code Here

    private void errBadTextContent(DatatypeException e, Class<?> datatypeClass,
            String localName, String uri) throws SAXException,
            ClassNotFoundException {
        if (getErrorHandler() != null) {
            Html5DatatypeException ex5 = (Html5DatatypeException) e;
            boolean warning = ex5.isWarning() ? true : false;
            DatatypeMismatchException dme = new DatatypeMismatchException(
                    "The text content of element \u201c" + localName
                            // + "\u201D from namespace \u201C" + uri
                            + "\u201d was not in the required format: "
                            + e.getMessage().split(": ")[1],
View Full Code Here

    public DatatypeMismatchException(String message, Locator locator,
            Class<?> datatypeClass, boolean warning) throws SAXException,
            ClassNotFoundException {
        super(message, locator);
        this.warning = warning;
        Html5DatatypeException ex5 = new Html5DatatypeException(0,
                datatypeClass, "", "", warning);
        this.exceptions = new HashMap<String, DatatypeException>();
        this.exceptions.put("", ex5);
    }
View Full Code Here

                BadAttributeValueException ex = (BadAttributeValueException) e;
                Map<String, DatatypeException> datatypeErrors = ex.getExceptions();
                for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
                    DatatypeException dex = entry.getValue();
                    if (dex instanceof Html5DatatypeException) {
                        Html5DatatypeException ex5 = (Html5DatatypeException) dex;
                        if (ex5.isWarning()) {
                            exceptionIsWarning = true;
                            return;
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.whattf.datatype.Html5DatatypeException

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.