KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > loom > components > util > profile > ComponentProfile


1 /*
2  * Copyright (C) The Loom Group. All rights reserved.
3  *
4  * This software is published under the terms of the Loom
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.loom.components.util.profile;
9
10 import org.codehaus.loom.components.util.info.ComponentInfo;
11 import org.codehaus.loom.components.util.metadata.ComponentTemplate;
12
13 /**
14  * The ComponentProfile defines a component as a conjunction of the
15  * ComponentInfo and ComponentTemplate. The ComponentInfo defines the type of
16  * the component and the ComponentTemplate defines the data required to
17  * construct a specific instance of the component.
18  *
19  * @author Peter Donald
20  * @version $Revision: 1.2 $ $Date: 2004/05/01 12:48:35 $
21  */

22 public class ComponentProfile
23 {
24     /** An empty array of component profiles. */
25     public static final ComponentProfile[] EMPTY_SET = new ComponentProfile[ 0 ];
26
27     /** The ComponentInfo that describes the type of this component. */
28     private final ComponentInfo m_info;
29
30     /** The ComponentTemplate that describes this component. */
31     private final ComponentTemplate m_metaData;
32
33     /**
34      * Creation of a new <code>ComponentProfile</code> instance.
35      *
36      * @param metaData the ComponentTemplate instance defining the component.
37      */

38     public ComponentProfile( final ComponentInfo info,
39                              final ComponentTemplate metaData )
40     {
41         if( null == info )
42         {
43             throw new NullPointerException JavaDoc( "info" );
44         }
45         if( null == metaData )
46         {
47             throw new NullPointerException JavaDoc( "metaData" );
48         }
49         m_info = info;
50         m_metaData = metaData;
51     }
52
53     /**
54      * Returns the underlying ComponentInfo instance.
55      *
56      * @return the component info instance
57      */

58     public ComponentInfo getInfo()
59     {
60         return m_info;
61     }
62
63     /**
64      * Returns the underlying ComponentTemplate instance.
65      *
66      * @return the component meta data instance
67      */

68     public ComponentTemplate getTemplate()
69     {
70         return m_metaData;
71     }
72 }
73
Popular Tags