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

COVERAGE SUMMARY FOR SOURCE FILE [CniTypePrinter.java]

nameclass, %method, %block, %line, %
CniTypePrinter.java67%  (2/3)88%  (7/8)71%  (52/73)71%  (20/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CniTypePrinter$WrapIOException0%   (0/1)0%   (0/1)0%   (0/4)0%   (0/2)
CniTypePrinter$WrapIOException (IOException): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class CniTypePrinter$BuildCxxName100% (1/1)100% (3/3)73%  (32/44)75%  (12/16)
visitClassName (String): void 100% (1/1)62%  (10/16)67%  (4/6)
visitPartName (String): void 100% (1/1)62%  (10/16)67%  (4/6)
CniTypePrinter$BuildCxxName (Writer): void 100% (1/1)100% (12/12)100% (4/4)
     
class CniTypePrinter100% (1/1)100% (4/4)80%  (20/25)80%  (8/10)
objectCxxType (Writer, Class): void 100% (1/1)67%  (10/15)67%  (4/6)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
CniTypePrinter (): void 100% (1/1)100% (3/3)100% (2/2)
getInstance (): JniTypePrinter 100% (1/1)100% (2/2)100% (1/1)

1/*
2 * $Id: CniTypePrinter.java,v 1.6 2004/06/16 21:30:14 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 */
12 
13package com.moesol.generator.printer;
14 
15import java.io.*;
16 
17import com.moesol.generator.core.JniMangleFilterWriter;
18import com.moesol.generator.core.VisitClassName;
19import com.moesol.generator.visitor.*;
20 
21/**
22 * Print types out in a manner suitable for interfacing with Cni,
23 * including return types and parameters.
24 */
25public class CniTypePrinter extends JniTypePrinter {
26    private static CniTypePrinter instance = new CniTypePrinter();
27    public static JniTypePrinter getInstance() {
28        return instance;
29    }
30 
31    protected void objectCxxType(Writer out, Class type) throws IOException {
32        BuildCxxName v = new BuildCxxName(out);
33        try {
34            VisitClassName.visit(type, v);
35        } catch (WrapIOException e) {
36            throw (IOException)e.getCause();
37        }
38    }
39    private static class WrapIOException extends RuntimeException {
40        public WrapIOException(IOException e) {
41            super(e);
42        }
43    }
44    private static class BuildCxxName implements ClassNameVisitor {
45        public BuildCxxName(Writer out) {
46            m_out = out;
47            m_mangled_out = new JniMangleFilterWriter(out);
48        }
49        public void visitPartName(String name) {
50            try {
51                    m_out.write("::");
52                m_mangled_out.write(name);
53            } catch (IOException e) {
54                throw new WrapIOException(e);
55            }
56        }
57        public void visitClassName(String name) {
58            try {
59                    m_out.write("::");
60                m_mangled_out.write(name);
61            } catch (IOException e) {
62                throw new WrapIOException(e);
63            }
64        }
65       
66        private Writer m_out;
67        private JniMangleFilterWriter m_mangled_out;
68    }
69}

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