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