001// Licensed under the Apache License, Version 2.0 (the "License");
002// you may not use this file except in compliance with the License.
003// You may obtain a copy of the License at
004//
005// http://www.apache.org/licenses/LICENSE-2.0
006//
007// Unless required by applicable law or agreed to in writing, software
008// distributed under the License is distributed on an "AS IS" BASIS,
009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
010// See the License for the specific language governing permissions and
011// limitations under the License.
012
013package org.apache.tapestry5.services.transform;
014
015import org.apache.tapestry5.ioc.annotations.UsesOrderedConfiguration;
016import org.apache.tapestry5.ioc.services.ChainBuilder;
017import org.apache.tapestry5.model.MutableComponentModel;
018import org.apache.tapestry5.plastic.PlasticClass;
019
020/**
021 * Interface for a set of objects that can perform transformation of component classes. Implementations should
022 * be thread safe and ideally stateless (all necessary state can be stored inside the {@link PlasticClass}).
023 *
024 * The ComponentClassTransformWorker service uses an ordered configuration of these works as a {@linkplain ChainBuilder
025 * chain of command}.
026 *
027 * @see PlasticClass
028 * @since 5.3
029 */
030@UsesOrderedConfiguration(ComponentClassTransformWorker2.class)
031public interface ComponentClassTransformWorker2
032{
033    /**
034     * Invoked to perform part of the transformation of the {@link PlasticClass}.
035     *
036     * @param plasticClass component class being transformed
037     * @param support      additional utilities needed during the transformation
038     * @param model        the model for the component being transformed
039     */
040    void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model);
041}