1 package net.sf.cglib.transform.impl;
2
3 import net.sf.cglib.transform.*;
4 import java.util.*;
5 import net.sf.cglib.core.*;
6 import org.objectweb.asm.Type;
7
8 public class AddPropertyTransformer extends ClassEmitterTransformer {
9 private final String[] names;
10 private final Type[] types;
11
12 public AddPropertyTransformer(Map props) {
13 int size = props.size();
14 names = (String[])props.keySet().toArray(new String[size]);
15 types = new Type[size];
16 for (int i = 0; i < size; i++) {
17 types[i] = (Type)props.get(names[i]);
18 }
19 }
20
21 public AddPropertyTransformer(String[] names, Type[] types) {
22 this.names = names;
23 this.types = types;
24 }
25
26 public void end_class() {
27 if (!TypeUtils.isAbstract(getAccess())) {
28 EmitUtils.add_properties(this, names, types);
29 }
30 super.end_class();
31 }
32 }
This page was automatically generated by Maven