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    
015    package org.apache.tapestry5.services.transform;
016    
017    import org.apache.tapestry5.ioc.annotations.UsesOrderedConfiguration;
018    import org.apache.tapestry5.ioc.services.ChainBuilder;
019    import org.apache.tapestry5.model.MutableComponentModel;
020    import org.apache.tapestry5.plastic.PlasticClass;
021    import org.apache.tapestry5.services.ComponentClassTransformWorker;
022    
023    /**
024     * Interface for a set of objects that can perform transformation of component classes. Implementations should
025     * be thread safe and ideally stateless (all necessary state can be stored inside the {@link PlasticClass}).
026     * <p>
027     * The ComponentClassTransformWorker service uses an ordered configuration of these works as a {@linkplain ChainBuilder
028     * chain of command}. For compatibility with the code compiled for Tapestry 5.2, contributions of type
029     * {@link ComponentClassTransformWorker} are type coerced into this type automatically.
030     * 
031     * @since 5.3
032     * @see PlasticClass
033     */
034    @UsesOrderedConfiguration(ComponentClassTransformWorker2.class)
035    public interface ComponentClassTransformWorker2
036    {
037        /**
038         * Invoked to perform part of the transformation of the {@link PlasticClass}.
039         * 
040         * @param plasticClass
041         *            component class being transformed
042         * @param support
043         *            additional utilities needed during the transformation
044         * @param model
045         *            the model for the component being transformed
046         */
047        void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model);
048    }