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

COVERAGE SUMMARY FOR SOURCE FILE [CniNameTypePrinter.java]

nameclass, %method, %block, %line, %
CniNameTypePrinter.java0%   (0/3)0%   (0/8)0%   (0/51)0%   (0/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CniNameTypePrinter0%   (0/1)0%   (0/4)0%   (0/25)0%   (0/9)
<static initializer> 0%   (0/1)0%   (0/5)0%   (0/1)
CniNameTypePrinter (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getInstance (): JniTypePrinter 0%   (0/1)0%   (0/2)0%   (0/1)
objectCxxType (Writer, Class): void 0%   (0/1)0%   (0/15)0%   (0/6)
     
class CniNameTypePrinter$BuildCxxName0%   (0/1)0%   (0/3)0%   (0/22)0%   (0/9)
CniNameTypePrinter$BuildCxxName (Writer): void 0%   (0/1)0%   (0/9)0%   (0/3)
visitClassName (String): void 0%   (0/1)0%   (0/12)0%   (0/5)
visitPartName (String): void 0%   (0/1)0%   (0/1)0%   (0/1)
     
class CniNameTypePrinter$WrapIOException0%   (0/1)0%   (0/1)0%   (0/4)0%   (0/2)
CniNameTypePrinter$WrapIOException (IOException): void 0%   (0/1)0%   (0/4)0%   (0/2)

1/*
2 * $Id: CniNameTypePrinter.java,v 1.2 2005/12/20 18:09:38 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 CniNameTypePrinter extends JniTypePrinter {
26    protected CniNameTypePrinter() { }
27    private static CniNameTypePrinter instance = new CniNameTypePrinter();
28    public static JniTypePrinter getInstance() {
29        return instance;
30    }
31 
32    protected void objectCxxType(Writer out, Class type) throws IOException {
33        BuildCxxName v = new BuildCxxName(out);
34        try {
35            VisitClassName.visit(type, v);
36        } catch (WrapIOException e) {
37            throw (IOException)e.getCause();
38        }
39    }
40    private static class WrapIOException extends RuntimeException {
41        public WrapIOException(IOException e) {
42            super(e);
43        }
44    }
45    private static class BuildCxxName implements ClassNameVisitor {
46        public BuildCxxName(Writer out) {
47            // m_out = out;
48            m_mangled_out = new JniMangleFilterWriter(out);
49        }
50        public void visitPartName(String name) {
51        }
52        public void visitClassName(String name) {
53            try {
54                m_mangled_out.write(name);
55            } catch (IOException e) {
56                throw new WrapIOException(e);
57            }
58        }
59       
60        // private Writer m_out;
61        private JniMangleFilterWriter m_mangled_out;
62    }
63}

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