Package org.thymeleaf.exceptions

Examples of org.thymeleaf.exceptions.ConfigurationException


           
            /*
             * Checking Resource Resolver
             */
            if (this.resourceResolver == null) {
                throw new ConfigurationException("Cannot initialize template resolver: a resource resolver has not been set");
            }
           
            /*
             *  Initialize pattern specs to avoid further modifications
             */
 
View Full Code Here


     *
     * @param resourceResolver the new resource resolver
     */
    @Override
    public void setResourceResolver(final IResourceResolver resourceResolver) {
        throw new ConfigurationException(
                "Cannot set a resource resolver on " + this.getClass().getName() + ". If " +
                "you want to set your own resource resolver, use " + TemplateResolver.class.getName() +
                "instead");
    }
View Full Code Here

     *
     * @param resourceResolver the new resource resolver
     */
    @Override
    public void setResourceResolver(final IResourceResolver resourceResolver) {
        throw new ConfigurationException(
                "Cannot set a resource resolver on " + this.getClass().getName() + ". If " +
                "you want to set your own resource resolver, use " + TemplateResolver.class.getName() +
                "instead");
    }
View Full Code Here

   
   
    public final Document parseTemplate(final Configuration configuration, final String documentName, final Reader reader) {
        if (!this.nekoInClasspath) {
            throw new ConfigurationException(
                    "Cannot perform conversion to XML from legacy HTML: The nekoHTML library " +
                    "is not in classpath. nekoHTML 1.9.15 or newer is required for processing templates in " +
                    "\"" + this.templateModeName + "\" mode [http://nekohtml.sourceforge.net]. Maven spec: " +
                    "\"net.sourceforge.nekohtml::nekohtml::1.9.15\". IMPORTANT: DO NOT use versions of " +
                    "nekoHTML older than 1.9.15.");
View Full Code Here

                config.setProperty("http://cyberneko.org/html/properties/names/attrs", "no-change");

                return new org.apache.xerces.parsers.DOMParser(config);
               
            } catch(final Exception e) {
                throw new ConfigurationException(
                    "Error while creating nekoHTML-based parser for " +
                    "LEGACYHTML5 template modes.", e);
            }
           
        }
View Full Code Here

     *
     * @param resourceResolver the new resource resolver
     */
    @Override
    public void setResourceResolver(final IResourceResolver resourceResolver) {
        throw new ConfigurationException(
                "Cannot set a resource resolver on " + this.getClass().getName() + ". If " +
                "you want to set your own resource resolver, use " + TemplateResolver.class.getName() +
                "instead");
    }
View Full Code Here

     *
     * @param resourceResolver the new resource resolver
     */
    @Override
    public void setResourceResolver(final IResourceResolver resourceResolver) {
        throw new ConfigurationException(
                "Cannot set a resource resolver on " + this.getClass().getName() + ". If " +
                "you want to set your own resource resolver, use " + TemplateResolver.class.getName() +
                "instead");
    }
View Full Code Here

            if (StandardDialect.class.isAssignableFrom(dialect.getClass())) {
                return dialectByPrefix.getKey();
            }
        }

        throw new ConfigurationException(
                "A Thymeleaf Standard Dialect has not been found in the current configuration, but it is " +
                "required in order to use " + StandardDOMSelectorFragmentSpec.class.getName());

    }
View Full Code Here

           
            for (final IProcessor processor : this.processors) {

                final IProcessorMatcher<? extends Node> processorMatcher = processor.getMatcher();
                if (processorMatcher == null) {
                    throw new ConfigurationException(
                            "Processor of class \"" + processor.getClass().getName() + "\" " +
                            "returned null processor matcher.");
                }
               
                if (processorMatcher instanceof IElementNameProcessorMatcher) {
                    // Processor will be indexed as "specific" for one or more element names
                   
                    final String[] elementNames = ((IElementNameProcessorMatcher) processorMatcher).getElementNames(context);
                    if (elementNames == null) {
                        throw new ConfigurationException(
                                "Processor of class \"" + processor.getClass().getName() + "\" " +
                                "returned a null element name as a part of its applicability specifications.");
                    }

                    for (final String elementName : elementNames) {
                        Set<ProcessorAndContext> processorsForElementName = newSpecificProcessorsByElementName.get(elementName);
                        if (processorsForElementName == null) {
                            processorsForElementName = new HashSet<ProcessorAndContext>(20);
                            newSpecificProcessorsByElementName.put(elementName, processorsForElementName);
                        }
                        processorsForElementName.add(new ProcessorAndContext(processor, context));
                    }


                }
               
                if (processorMatcher instanceof IAttributeNameProcessorMatcher) {
                    // Processor will be indexed as "specific" for one or more attribute names
                   
                   
                    final String[] attributeNames = ((IAttributeNameProcessorMatcher) processorMatcher).getAttributeNames(context);
                    if (attributeNames == null) {
                        throw new ConfigurationException(
                                "Processor of class \"" + processor.getClass().getName() + "\" " +
                                "returned a null attribute name as a part of its applicability specifications.");
                    }

                    for (final String attributeName : attributeNames) {
View Full Code Here

    private void validateDocTypeTranslations() {
       
        for (final IDocTypeTranslation translation : this.docTypeTranslations) {
           
            if (translation.getSourcePublicID() == null) {
                throw new ConfigurationException(
                        "Translation specifies a null Source PUBLICID. " +
                        "Document Type identifiers should never be null. " +
                        "Use \"NONE\" if you want to specify a non-existent identifier");
            }
            if (translation.getSourceSystemID() == null) {
                throw new ConfigurationException(
                        "Translation specifies a null Source SYSTEMID. " +
                        "Document Type identifiers should never be null. " +
                        "Use \"NONE\" if you want to specify a non-existent identifier");
            }
            if (translation.getTargetPublicID() == null) {
                throw new ConfigurationException(
                        "Translation specifies a null Target PUBLICID. " +
                        "Document Type identifiers should never be null. " +
                        "Use \"NONE\" if you want to specify a non-existent identifier");
            }
            if (translation.getTargetSystemID() == null) {
                throw new ConfigurationException(
                        "Translation specifies a null Target SYSTEMID. " +
                        "Document Type identifiers should never be null. " +
                        "Use \"NONE\" if you want to specify a non-existent identifier");
            }
           
View Full Code Here

TOP

Related Classes of org.thymeleaf.exceptions.ConfigurationException

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.