1 /*2 * JBoss, Home of Professional Open Source3 * Copyright 2005, JBoss Inc., and individual contributors as indicated4 * by the @authors tag. See the copyright.txt in the distribution for a5 * full listing of individual contributors.6 *7 * This is free software; you can redistribute it and/or modify it8 * under the terms of the GNU Lesser General Public License as9 * published by the Free Software Foundation; either version 2.1 of10 * the License, or (at your option) any later version.11 *12 * This software is distributed in the hope that it will be useful,13 * but WITHOUT ANY WARRANTY; without even the implied warranty of14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU15 * Lesser General Public License for more details.16 *17 * You should have received a copy of the GNU Lesser General Public18 * License along with this software; if not, write to the Free19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.21 */22 package org.jboss.aop.annotation.compiler;23 24 import javassist.bytecode.ConstPool;25 import javassist.bytecode.annotation.AnnotationMemberValue;26 import javassist.bytecode.annotation.ArrayMemberValue;27 import javassist.bytecode.annotation.BooleanMemberValue;28 import javassist.bytecode.annotation.ByteMemberValue;29 import javassist.bytecode.annotation.CharMemberValue;30 import javassist.bytecode.annotation.ClassMemberValue;31 import javassist.bytecode.annotation.DoubleMemberValue;32 import javassist.bytecode.annotation.EnumMemberValue;33 import javassist.bytecode.annotation.FloatMemberValue;34 import javassist.bytecode.annotation.IntegerMemberValue;35 import javassist.bytecode.annotation.LongMemberValue;36 import javassist.bytecode.annotation.MemberValue;37 import javassist.bytecode.annotation.MemberValueVisitor;38 import javassist.bytecode.annotation.ShortMemberValue;39 import javassist.bytecode.annotation.StringMemberValue;40 41 /**42 * Comment43 *44 * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>45 * @version $Revision: 37406 $46 *47 **/48 public class MemberValueCreation implements MemberValueVisitor49 {50 public MemberValue value;51 private ConstPool cp;52 53 public MemberValueCreation(ConstPool cp)54 {55 this.cp = cp;56 }57 58 public void visitAnnotationMemberValue(AnnotationMemberValue annotationMemberValue)59 {60 value = new AnnotationMemberValue(cp);61 }62 63 public void visitArrayMemberValue(ArrayMemberValue arrayMemberValue)64 {65 throw new RuntimeException ("NOT IMPLEMENTED");66 }67 68 public void visitBooleanMemberValue(BooleanMemberValue booleanMemberValue)69 {70 value = new BooleanMemberValue(cp);71 }72 73 public void visitByteMemberValue(ByteMemberValue byteMemberValue)74 {75 value = new ByteMemberValue(cp);76 }77 78 public void visitCharMemberValue(CharMemberValue charMemberValue)79 {80 value = new CharMemberValue(cp);81 }82 83 public void visitDoubleMemberValue(DoubleMemberValue doubleMemberValue)84 {85 value = new DoubleMemberValue(cp);86 }87 88 public void visitEnumMemberValue(EnumMemberValue enumMemberValue)89 {90 value = new EnumMemberValue(cp);91 }92 93 public void visitFloatMemberValue(FloatMemberValue floatMemberValue)94 {95 value = new FloatMemberValue(cp);96 }97 98 public void visitIntegerMemberValue(IntegerMemberValue integerMemberValue)99 {100 value = new IntegerMemberValue(cp);101 }102 103 public void visitLongMemberValue(LongMemberValue longMemberValue)104 {105 value = new LongMemberValue(cp);106 }107 108 public void visitShortMemberValue(ShortMemberValue shortMemberValue)109 {110 value = new ShortMemberValue(cp);111 }112 113 public void visitStringMemberValue(StringMemberValue stringMemberValue)114 {115 value = new StringMemberValue(cp);116 }117 118 public void visitClassMemberValue(ClassMemberValue classMemberValue)119 {120 value = new ClassMemberValue(cp);121 }122 }123