EMMA Coverage Report (generated Mon Nov 29 14:43:38 PST 2010)
[all classes][com.jeantessier.classreader.impl]

COVERAGE SUMMARY FOR SOURCE FILE [Custom_attribute.java]

nameclass, %method, %block, %line, %
Custom_attribute.java100% (1/1)71%  (5/7)53%  (48/91)76%  (13/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Custom_attribute100% (1/1)71%  (5/7)53%  (48/91)76%  (13/17)
Custom_attribute (ConstantPool, Visitable, DataInput): void 0%   (0/1)0%   (0/7)0%   (0/2)
toString (): String 0%   (0/1)0%   (0/18)0%   (0/1)
Custom_attribute (String, ConstantPool, Visitable, DataInput): void 100% (1/1)67%  (36/54)89%  (8/9)
accept (Visitor): void 100% (1/1)100% (4/4)100% (2/2)
getAttributeName (): String 100% (1/1)100% (2/2)100% (1/1)
getInfo (): byte [] 100% (1/1)100% (3/3)100% (1/1)
getName (): String 100% (1/1)100% (3/3)100% (1/1)

1/*
2 *  Copyright (c) 2001-2009, Jean Tessier
3 *  All rights reserved.
4 *  
5 *  Redistribution and use in source and binary forms, with or without
6 *  modification, are permitted provided that the following conditions
7 *  are met:
8 *  
9 *      * Redistributions of source code must retain the above copyright
10 *        notice, this list of conditions and the following disclaimer.
11 *  
12 *      * Redistributions in binary form must reproduce the above copyright
13 *        notice, this list of conditions and the following disclaimer in the
14 *        documentation and/or other materials provided with the distribution.
15 *  
16 *      * Neither the name of Jean Tessier nor the names of his contributors
17 *        may be used to endorse or promote products derived from this software
18 *        without specific prior written permission.
19 *  
20 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 *  A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
24 *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 
33package com.jeantessier.classreader.impl;
34 
35import java.io.*;
36 
37import org.apache.log4j.*;
38 
39import com.jeantessier.classreader.*;
40import com.jeantessier.text.*;
41 
42public class Custom_attribute extends Attribute_info implements com.jeantessier.classreader.Custom_attribute {
43    private String name;
44    private byte[] info;
45 
46    public Custom_attribute(ConstantPool constantPool, Visitable owner, DataInput in) throws IOException {
47        this("", constantPool, owner, in);
48    }
49 
50    public Custom_attribute(String name, ConstantPool constantPool, Visitable owner, DataInput in) throws IOException {
51        super(constantPool, owner);
52 
53        this.name = name;
54 
55        int byteCount = in.readInt();
56        Logger.getLogger(getClass()).debug("Attribute length: " + byteCount);
57 
58        this.info = new byte[byteCount];
59        in.readFully(info);
60 
61        if (Logger.getLogger(getClass()).isDebugEnabled()) {
62            Logger.getLogger(getClass()).debug("Read " + byteCount + " byte(s): " + Hex.toString(this.info));
63        }
64    }
65 
66    public String getName() {
67        return name;
68    }
69 
70    public byte[] getInfo() {
71        return info;
72    }
73 
74    public String toString() {
75        return "Custom \"" + name + "\" " + getInfo().length + " byte(s)";
76    }
77 
78    public String getAttributeName() {
79        return "Custom";
80    }
81 
82    public void accept(Visitor visitor) {
83        visitor.visitCustom_attribute(this);
84    }
85}

[all classes][com.jeantessier.classreader.impl]
EMMA 2.0.5312 (C) Vladimir Roubtsov