KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > metadata > BlockMetaData


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

8 package org.apache.avalon.phoenix.metadata;
9
10 import org.apache.avalon.phoenix.metainfo.BlockInfo;
11
12 /**
13  * This is the structure describing each block.
14  *
15  * @author <a HREF="mailto:peter at apache.org">Peter Donald</a>
16  */

17 public class BlockMetaData
18 {
19     private final String JavaDoc m_name;
20
21     private final DependencyMetaData[] m_dependencies;
22
23     private final boolean m_disableProxy;
24
25     private final BlockInfo m_blockInfo;
26
27     public BlockMetaData( final String JavaDoc name,
28                           final DependencyMetaData[] dependencies,
29                           final boolean disableProxy,
30                           final BlockInfo blockInfo )
31     {
32         m_name = name;
33         m_dependencies = dependencies;
34         m_disableProxy = disableProxy;
35         m_blockInfo = blockInfo;
36     }
37
38     public String JavaDoc getName()
39     {
40         return m_name;
41     }
42
43     /**
44      * @deprecated Please use {@link #getImplementationKey} instead.
45      */

46     public String JavaDoc getClassname()
47     {
48         return getImplementationKey();
49     }
50
51     public String JavaDoc getImplementationKey()
52     {
53         return getBlockInfo().getBlockDescriptor().getImplementationKey();
54     }
55
56     public BlockInfo getBlockInfo()
57     {
58         return m_blockInfo;
59     }
60
61     public DependencyMetaData getDependency( final String JavaDoc name )
62     {
63         for( int i = 0; i < m_dependencies.length; i++ )
64         {
65             if( m_dependencies[ i ].getRole().equals( name ) )
66             {
67                 return m_dependencies[ i ];
68             }
69         }
70
71         return null;
72     }
73
74     public DependencyMetaData[] getDependencies()
75     {
76         return m_dependencies;
77     }
78
79     public boolean isDisableProxy()
80     {
81         return m_disableProxy;
82     }
83 }
84
Popular Tags