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.internal.services;
014
015import org.apache.tapestry5.model.ComponentModel;
016
017/**
018 * Access to component models (as provided via {@link org.apache.tapestry5.internal.services.ComponentInstantiatorSource}).
019 *
020 * This is a good candidate to move into the public services package.
021 *
022 * @since 5.1.0.0
023 */
024public interface ComponentModelSource
025{
026    /**
027     * Returns the model for a particular component class name.
028     *
029     * @param componentClassName name of component class
030     * @return model for component
031     * @throws IllegalArgumentException if component class name does not match a known component
032     */
033    ComponentModel getModel(String componentClassName);
034
035    /**
036     * Returns the model for a page.  The page name is resolved to a component class name.
037     *
038     * @param pageName name of page
039     * @return the model for the page
040     * @throws IllegalArgumentException if the page name is not a known page name
041     */
042    ComponentModel getPageModel(String pageName);
043}