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

COVERAGE SUMMARY FOR SOURCE FILE [JniDoParamsVisitor.java]

nameclass, %method, %block, %line, %
JniDoParamsVisitor.java0%   (0/1)0%   (0/4)0%   (0/73)0%   (0/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class JniDoParamsVisitor0%   (0/1)0%   (0/4)0%   (0/73)0%   (0/21)
JniDoParamsVisitor (Writer, TranslationContext): void 0%   (0/1)0%   (0/9)0%   (0/4)
getTranslatedParam (Class): String 0%   (0/1)0%   (0/36)0%   (0/8)
visitParamSeparator (Class): void 0%   (0/1)0%   (0/1)0%   (0/1)
visitParamType (Class, int, Class): void 0%   (0/1)0%   (0/27)0%   (0/8)

1//
2// (c) Copyright, Moebius Solutions, 2002
3//
4//                       All Rights Reserved
5//
6// This material may be reproduced by or for the U. S. Government
7// pursuant to the copyright license under the clause at
8// DFARS 252.227-7013 (OCT 1988).
9//
10/*
11 * $Id: JniDoParamsVisitor.java,v 1.1.1.5 2004/05/25 20:23:29 hastings Exp $
12 */
13package com.moesol.generator;
14 
15import java.io.*;
16import com.moesol.generator.core.*;
17import com.moesol.generator.printer.*;
18import com.moesol.generator.visitor.*;
19 
20public class JniDoParamsVisitor implements ParamTypeVisitor{
21    public JniDoParamsVisitor(Writer out, TranslationContext ctx) {
22        this.out = out;
23        m_trans_ctx = ctx;
24    }
25    public void visitParamType(Class c, int nparam, Class paramType) throws ApplyException {
26        try {
27            out.write(", ");
28            out.write(getTranslatedParam(paramType));
29            out.write(" p");
30            out.write(Integer.toString(nparam));
31        } catch (IOException e) {
32            throw new ApplyException(e);
33        }
34    }
35    public void visitParamSeparator(Class c) throws ApplyException {
36    }
37    
38    /* TODO refactor */
39    String getTranslatedParam(Class paramType) throws IOException, ApplyException {
40        StringWriter sw = new StringWriter();
41        JavaTypePrinter.getInstance().print(paramType, sw);
42        String trans = m_trans_ctx.getProperty("jni.do.type." + sw.toString());
43        if (trans != null) {
44            // found a translation
45            return trans;
46        }
47 
48        sw = new StringWriter();
49        JniTypePrinter.getInstance().print(paramType, sw);
50        return sw.toString();
51    }
52    
53    private Writer out;
54    private TranslationContext m_trans_ctx;
55}

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