~ubuntu-branches/ubuntu/trusty/cglib/trusty

« back to all changes in this revision

Viewing changes to src/proxy/net/sf/cglib/transform/ClassReaderGenerator.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2009-10-08 21:23:45 UTC
  • Revision ID: james.westby@ubuntu.com-20091008212345-t2zy5hv2g8o4i40k
Tags: upstream-2.2+dfsg
ImportĀ upstreamĀ versionĀ 2.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2003 The Apache Software Foundation
 
3
 *
 
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 *
 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 *  Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
package net.sf.cglib.transform;
 
17
 
 
18
import net.sf.cglib.core.ClassGenerator;
 
19
import org.objectweb.asm.Attribute;
 
20
import org.objectweb.asm.ClassReader;
 
21
import org.objectweb.asm.ClassVisitor;
 
22
 
 
23
public class ClassReaderGenerator implements ClassGenerator {
 
24
    private final ClassReader r;
 
25
    private final Attribute[] attrs;
 
26
    private final int flags;
 
27
    
 
28
    public ClassReaderGenerator(ClassReader r, int flags) {
 
29
        this(r, null, flags);
 
30
    }
 
31
 
 
32
    public ClassReaderGenerator(ClassReader r, Attribute[] attrs, int flags) {
 
33
        this.r = r;
 
34
        this.attrs = (attrs != null) ? attrs : new Attribute[0];
 
35
        this.flags = flags;
 
36
    }
 
37
    
 
38
    public void generateClass(ClassVisitor v) {
 
39
        r.accept(v, attrs, flags);
 
40
    }
 
41
}