Package org.apache.cocoon.components.validation

Examples of org.apache.cocoon.components.validation.ValidatorException


            }

            /* If still we didn't find any parser, simply die of natural death */
            if (parser == null) {
                String message = "Unsupported grammar language" + grammar;
                throw new ValidatorException(message);
            }

            /* Somehow we have a schema parser, check it supports the gramar */
            String languages[] = parser.getSupportedGrammars();
            for (int x = 0; x < languages.length; x++) {
                if (! language.equals(languages[x])) continue;
                /* Hah! language supported, go ahead and parse now */
                Schema schema = this.getSchema(parser, source, language);
                return schema.createValidator(errorHandler);
            }

            /* Something really odd going on, this should never happen */
            String message = "Schema parser " + parser.getClass().getName() +
                             " does not support grammar " + grammar;
            throw new ValidatorException(message);

        } finally {
            if (parser != null) this.releaseParser(parser);
        }
    }
View Full Code Here


        try {
            return parser.parseSchema(source, grammar);
        } catch (IllegalArgumentException exception) {
            String message = "Schema parser " + parser.getClass().getName() +
                             " does not support grammar " + grammar;
            throw new ValidatorException(message, exception);
        }
    }
View Full Code Here

            if (xmlParser != null) this.manager.release(xmlParser);
        }

        if (("".equals(grammar)) || (grammar == null)) {
            String message = "Unable to detect grammar for schema at ";
            throw new ValidatorException(message + source.getURI());
        } else {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Grammar \"" + grammar + "\" detected for " +
                                  "schema \"" + source.getURI());
            }
View Full Code Here

            }

            /* If still we didn't find any parser, simply die of natural death */
            if (parser == null) {
                String message = "Unsupported grammar language" + grammar;
                throw new ValidatorException(message);
            }

            /* Somehow we have a schema parser, check it supports the gramar */
            String languages[] = parser.getSupportedGrammars();
            for (int x = 0; x < languages.length; x++) {
                if (! language.equals(languages[x])) continue;
                /* Hah! language supported, go ahead and parse now */
                Schema schema = this.getSchema(parser, source, language);
                return schema.createValidator(errorHandler);
            }

            /* Something really odd going on, this should never happen */
            String message = "Schema parser " + parser.getClass().getName() +
                             " does not support grammar " + grammar;
            throw new ValidatorException(message);

        } finally {
            if (parser != null) this.releaseParser(parser);
        }
    }
View Full Code Here

        try {
            return parser.parseSchema(source, grammar);
        } catch (IllegalArgumentException exception) {
            String message = "Schema parser " + parser.getClass().getName() +
                             " does not support grammar " + grammar;
            throw new ValidatorException(message, exception);
        }
    }
View Full Code Here

            if (xmlParser != null) this.manager.release(xmlParser);
        }

        if (("".equals(grammar)) || (grammar == null)) {
            String message = "Unable to detect grammar for schema at ";
            throw new ValidatorException(message + source.getURI());
        } else {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Grammar \"" + grammar + "\" detected for " +
                                  "schema \"" + source.getURI());
            }
View Full Code Here

            }

            /* If still we didn't find any parser, simply die of natural death */
            if (parser == null) {
                String message = "Unsupported grammar language" + grammar;
                throw new ValidatorException(message);
            }

            /* Somehow we have a schema parser, check it supports the gramar */
            String languages[] = parser.getSupportedGrammars();
            for (int x = 0; x < languages.length; x++) {
                if (! language.equals(languages[x])) continue;
                /* Hah! language supported, go ahead and parse now */
                Schema schema = this.getSchema(parser, source, language);
                return schema.createValidator(errorHandler);
            }

            /* Something really odd going on, this should never happen */
            String message = "Schema parser " + parser.getClass().getName() +
                             " does not support grammar " + grammar;
            throw new ValidatorException(message);

        } finally {
            if (parser != null) this.releaseParser(parser);
        }
    }
View Full Code Here

        try {
            return parser.parseSchema(source, grammar);
        } catch (IllegalArgumentException exception) {
            String message = "Schema parser " + parser.getClass().getName() +
                             " does not support grammar " + grammar;
            throw new ValidatorException(message, exception);
        }
    }
View Full Code Here

            if (xmlParser != null) this.manager.release(xmlParser);
        }

        if (("".equals(grammar)) || (grammar == null)) {
            String message = "Unable to detect grammar for schema at ";
            throw new ValidatorException(message + source.getURI());
        } else {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Grammar \"" + grammar + "\" detected for " +
                                  "schema \"" + source.getURI());
            }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.components.validation.ValidatorException

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.