public static void merge( EjbJar3xMetaData merged, EjbJar3xMetaData xml, EjbJar3xMetaData annotation) { // EnterpriseBeansMetaData first EnterpriseBeansMetaData enterpriseBeans = new EnterpriseBeansMetaData(); merge(enterpriseBeans, xml.getEnterpriseBeans(), annotation.getEnterpriseBeans()); merged.setEnterpriseBeans(enterpriseBeans); // AssemblyDescriptorMetaData AssemblyDescriptorMetaData assemblyDescriptor = new AssemblyDescriptorMetaData(); merge(assemblyDescriptor, xml.getAssemblyDescriptor(), annotation.getAssemblyDescriptor()); merged.setAssemblyDescriptor(assemblyDescriptor); // Description if (xml.getDescriptionGroup() != null) merged.setDescriptionGroup(xml.getDescriptionGroup()); // DTD info merged.setDTD(null, xml.getDtdPublicId(), xml.getDtdSystemId()); // Ejb client jar if (xml.getEjbClientJar() != null) merged.setEjbClientJar(xml.getEjbClientJar()); // ID if (xml.getId() != null) merged.setId(xml.getId()); // RelationsMetaData if (xml.getRelationships() != null) merged.setRelationships(xml.getRelationships()); // Version if (xml.getVersion() != null) merged.setVersion(xml.getVersion()); merged.setMetadataComplete(xml.isMetadataComplete()); if (xml.getInterceptors() != null || annotation.getInterceptors() != null) { InterceptorsMetaData interceptors = new InterceptorsMetaData(); interceptors.merge(xml.getInterceptors(), annotation.getInterceptors()); merged.setInterceptors(interceptors); } }
protected void assertInterceptors(IEjbJarMetaData<?, ?, ?, ?> ejbJarMetaData, Mode mode) { InterceptorsMetaData interceptorsMetaData = ejbJarMetaData.getInterceptors(); assertNotNull("interceptors is null", interceptorsMetaData); // assertId("interceptors", interceptorsMetaData); assertDescriptions("interceptors", interceptorsMetaData.getDescriptions()); assertEquals(2, interceptorsMetaData.size()); int count = 1; for (InterceptorMetaData interceptor : interceptorsMetaData) assertInterceptor("interceptor" + (count++), interceptor, mode); }