1 8 package org.codehaus.loom.components.util.info; 9 10 import java.io.Serializable ; 11 12 26 public class ComponentInfo 27 implements Serializable 28 { 29 30 private final Class m_type; 31 32 33 private final ServiceDescriptor[] m_services; 34 35 36 private final SchemaDescriptor m_configurationSchema; 37 38 39 private final DependencyDescriptor[] m_dependencies; 40 41 44 public ComponentInfo( final Class type, 45 final ServiceDescriptor[] services, 46 final DependencyDescriptor[] dependencies, 47 final SchemaDescriptor configurationSchema ) 48 { 49 if( null == type ) 50 { 51 throw new NullPointerException ( "type" ); 52 } 53 if( null == services ) 54 { 55 throw new NullPointerException ( "services" ); 56 } 57 if( null == dependencies ) 58 { 59 throw new NullPointerException ( "dependencies" ); 60 } 61 m_type = type; 62 m_services = services; 63 m_dependencies = dependencies; 64 m_configurationSchema = configurationSchema; 65 } 66 67 72 public Class getType() 73 { 74 return m_type; 75 } 76 77 82 public ServiceDescriptor[] getServices() 83 { 84 return m_services; 85 } 86 87 92 public SchemaDescriptor getConfigurationSchema() 93 { 94 return m_configurationSchema; 95 } 96 97 102 public DependencyDescriptor[] getDependencies() 103 { 104 return m_dependencies; 105 } 106 107 113 public DependencyDescriptor getDependency( final String key ) 114 { 115 for( int i = 0; i < m_dependencies.length; i++ ) 116 { 117 if( m_dependencies[ i ].getKey().equals( key ) ) 118 { 119 return m_dependencies[ i ]; 120 } 121 } 122 123 return null; 124 } 125 } 126 | Popular Tags |