EMMA Coverage Report (generated Mon Mar 20 21:34:30 PST 2006)
[all classes][com.moesol.bindings]

COVERAGE SUMMARY FOR SOURCE FILE [DispatchJavaCoClass.java]

nameclass, %method, %block, %line, %
DispatchJavaCoClass.java100% (1/1)100% (6/6)64%  (55/86)61%  (15.9/26)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DispatchJavaCoClass100% (1/1)100% (6/6)64%  (55/86)61%  (15.9/26)
forClass (Class): DispatchJavaCoClass 100% (1/1)33%  (15/45)33%  (5/15)
<static initializer> 100% (1/1)92%  (11/12)91%  (0.9/1)
DispatchJavaCoClass (): void 100% (1/1)100% (3/3)100% (2/2)
fillCoClassInfo (Class): void 100% (1/1)100% (8/8)100% (2/2)
fillImplementedCategories (Class): void 100% (1/1)100% (15/15)100% (5/5)
getImplementedCategories (): GUID [] 100% (1/1)100% (3/3)100% (1/1)

1/*
2 * $Id: DispatchJavaCoClass.java,v 1.3 2005/12/01 06:10:00 hastings Exp $
3 *
4 * (c) Copyright, Moebius Solutions, Inc., 2004
5 *
6 *                       All Rights Reserved
7 *
8 * This material may be reproduced by or for the U. S. Government
9 * pursuant to the copyright license under the clause at
10 * DFARS 252.227-7014 (OCT 2001).
11 */
12package com.moesol.bindings;
13 
14import java.util.logging.Level;
15import java.util.logging.Logger;
16 
17import com.moesol.bindings.platform_sdk.component_services.GUID;
18 
19public class DispatchJavaCoClass extends DispatchJavaCommon {
20        private static final Logger s_logger = Logger.getLogger(DispatchJavaCoClass.class.getName());
21        
22        private GUID[] m_implemented_categories;
23        
24        protected DispatchJavaCoClass() {
25        }
26 
27        //
28        // TODO All Dispatch<*> classes should probably move to component_services
29        // since we should be able to use h-gen without COM.
30        //
31        
32        /**
33         * @param c class of the interface
34         * @return a DispatchJavaCoClass that describes {@code c}.
35         */
36        public static DispatchJavaCoClass forClass(Class c) {
37                DispatchJavaCoClass r = new DispatchJavaCoClass();
38                try {
39                        r.fillLibraryInfo(c);
40                        r.fillCoClassInfo(c);
41                        r.fillImplementedCategories(c);
42                        
43                        return r;
44                } catch (SecurityException e) {
45                        throw new RuntimeException(e);
46                } catch (IllegalArgumentException e) {
47                        throw new RuntimeException(e);
48                } catch (ClassNotFoundException e) {
49                        throw new RuntimeException(e);
50                } catch (NoSuchFieldException e) {
51                        throw new RuntimeException(e);
52                } catch (IllegalAccessException e) {
53                        throw new RuntimeException(e);
54                }
55        }
56        
57        private void fillCoClassInfo(Class c) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
58                setUuid((GUID)getObjectField(c, "CLSID"));
59        }
60        
61        private void fillImplementedCategories(Class c) throws SecurityException, IllegalArgumentException, IllegalAccessException {
62                try {
63                        m_implemented_categories = (GUID[])getObjectField(c, "IMPLEMENTS_CATEGORIES");
64                } catch (NoSuchFieldException e) {
65                        s_logger.log(Level.FINE, "{0} not have a static field IMPLEMENTS_CATEGORIES", c);
66                }
67        }
68        
69        public GUID[] getImplementedCategories() {
70                return m_implemented_categories;
71        }
72}

[all classes][com.moesol.bindings]
EMMA 2.0.5312 (C) Vladimir Roubtsov