001    package railo.transformer.bytecode.util;
002    
003    import org.objectweb.asm.Type;
004    
005    import railo.runtime.exp.PageException;
006    
007    public final class ASMPropertyImpl implements ASMProperty {
008    
009    
010            private Type type;
011            private String name;
012            private Class clazz;
013            
014            public ASMPropertyImpl(Class type,String name){
015                    this.type=ASMUtil.toType(type, true);
016                    this.name=name;
017                    this.clazz=type;
018            }
019            public ASMPropertyImpl(String type,String name) throws PageException{
020                    this.type=ASMUtil.toType(type, true);
021                    this.name=name;
022            }
023            public ASMPropertyImpl(Type type,String name){
024                    this.type=type;
025                    this.name=name;
026            }
027            
028            /**
029             * @return the name
030             */
031            public String getName() {
032                    return name;
033            }
034    
035            /**
036             * @return the type
037             */
038            public Type getASMType() {
039                    return type;
040            }
041            
042            /**
043             *
044             * @see java.lang.Object#toString()
045             */
046            public String toString() {
047                    return "name:"+name+";type:"+type.getClassName();
048            }
049    
050    
051    
052            /**
053             * @return the clazz
054             */
055            public Class getClazz() {
056                    return clazz;
057            }
058    }