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

org.thymeleaf.model.ITemplateEvent Maven / Gradle / Ivy

Go to download

Modern server-side Java template engine for both web and standalone environments

There is a newer version: 3.1.3.RELEASE
Show newest version
/*
 * =============================================================================
 *
 *   Copyright (c) 2011-2018, The THYMELEAF team (http://www.thymeleaf.org)
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 * =============================================================================
 */
package org.thymeleaf.model;

import java.io.IOException;
import java.io.Writer;

/**
 * 

* Common interface for all template events generated by the parsers (and processed by the * implementations of {@link org.thymeleaf.engine.ITemplateHandler}. *

*

* Sequences of these events are used to represent templates or fragments of them, by means of * implementations of the {@link IModel} interface. *

*

* Note that any implementations of this interface should be immutable. *

* * @author Daniel Fernández * @since 3.0.0 * */ public interface ITemplateEvent { /** *

* Checks whether this event contains location information (template name, line and column). *

*

* Only events that are generated during the parsing of templates contain location info, locating them * in their original template. All events generated during template processing and not originally present * at the template do not contain this location data. *

* * @return whether the event contains location data or not. */ public boolean hasLocation(); /** *

* Returns the name of the template from which parsing this event was originally created. *

* * @return the name of the template */ public String getTemplateName(); /** *

* Returns the line at which this event can be found in the template specified by {@link #getTemplateName()}. *

* * @return the line number, starting in 1. */ public int getLine(); /** *

* Returns the column at which this event can be found in the template specified by {@link #getTemplateName()}. *

* * @return the column number, starting in 1. */ public int getCol(); /** *

* Accept a visitor, implementation of {@link IModelVisitor}. *

* * @param visitor the visitor. */ public void accept(final IModelVisitor visitor); /** *

* Writes this event to the specified {@link Writer}. *

*

* Template output performed at {@link org.thymeleaf.engine.OutputTemplateHandler} is done by calling * these methods at each of the events resulting from template processing. *

* * @param writer the writer this event should be written to. * @throws IOException if an input/output exception occurs. */ public void write(final Writer writer) throws IOException; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy