/** * Gets a long message if it is available. */ public String getReason() { if (message != null) return message; else return this.toString(); }
/** * Gets a long message if it is available. */ public String getReason() { if (message != null) return message; return this.toString(); }
/** * Gets a long message if it is available. */ public String getReason() { if (message != null) return message; else return this.toString(); }
/** * Gets a long message if it is available. */ public String getReason() { if (message != null) return message; else return this.toString(); }
/** * Gets a long message if it is available. */ public String getReason() { if (message != null) return message; else return this.toString(); }
/** * Gets a long message if it is available. */ public String getReason() { if (message != null) return message; else return this.toString(); }
/** * Gets a long message if it is available. */ public String getReason() { if (message != null) return message; else return this.toString(); }
public byte[] toByteCode() { try { return ctClass.toBytecode(); } catch (IOException e) { throw new RuntimeException(e.toString()); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }
public void addMethod(MutableMethodInfo mmi) { if(mmi instanceof JavassistMethodInfo) { try { ctClass.addMethod(((JavassistMethodInfo) mmi).getCtMethod()); clearMethodCache(); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } } }
public MutableMethodInfo createMutableMethod(Body body) { try { CtMethod method = CtNewMethod.make(body.getBody(), ctClass); return new JavassistMethodInfo(null, factory, this, method); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }
private void instrumentPre(CtMethod m, Pre pre) throws CannotCompileException { String preValue = pre.value(); if( preValue.trim().equals("")) { preValue = m.getName() + "$Pre($$)"; } String preMessage = pre.message(); String code = createCode(preValue, preMessage); try { m.insertBefore(code); } catch (CannotCompileException e) { throw new CannotCompileException(code + "\nCaused by: " + e.toString(), e); } }
public MutableConstructorInfo createMutableConstructor(Body body) { try { CtConstructor constructor = CtNewConstructor.make(body.getBody(), ctClass); return new JavassistConstructorInfo(null, factory, this, constructor); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }
public void addConstructor(MutableConstructorInfo mci) { if(mci instanceof JavassistConstructorInfo) { try { ctClass.addConstructor(((JavassistConstructorInfo) mci).getCtConstructor()); clearConstructorCache(); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } } }
public MutableFieldInfo createMutableField(int modifiers, ClassInfo type, String fieldName) { try { CtField field = new CtField(JavassistUtil.toCtClass(type), fieldName, ctClass); field.setModifiers(modifiers); return new JavassistFieldInfo(factory, this, field); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }
public MutableFieldInfo createMutableField(int modifiers, String type, String fieldName) { try { CtField field = new CtField(JavassistUtil.toCtClass(ctClass.getClassPool(), type), fieldName, ctClass); field.setModifiers(modifiers); return new JavassistFieldInfo(factory, this, field); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }
public void setParameters(String[] parameters) { for(String p : parameters) { try { ctBehavior.addParameter(JavassistUtil.toCtClass(typeInfo.getCtClass().getClassPool(), p)); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } } typeInfo.clearMethodCache(); }
public MutableConstructorInfo createMutableConstructor(int modifiers, Body body, ClassInfo[] parameters, ClassInfo[] exceptions) { try { CtConstructor constructor = CtNewConstructor.make(JavassistUtil.toCtClass(parameters), JavassistUtil.toCtClass(exceptions), body.getBody(), ctClass); constructor.setModifiers(modifiers); return new JavassistConstructorInfo(null, factory, this, constructor); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }
public MutableMethodInfo createMutableMethod(int modifiers, ClassInfo returnType, String methodName, Body body, ClassInfo[] parameters, ClassInfo[] exceptions) { try { CtMethod method = CtNewMethod.make(modifiers, JavassistUtil.toCtClass(returnType), methodName, JavassistUtil.toCtClass(parameters), JavassistUtil.toCtClass(exceptions), body.getBody(), ctClass); return new JavassistMethodInfo(null, factory, this, method); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }
public MutableConstructorInfo createMutableConstructor(int modifiers, String[] parameters, String[] exceptions) { try { CtConstructor constructor = CtNewConstructor.make(JavassistUtil.toCtClass(ctClass.getClassPool(), parameters), JavassistUtil.toCtClass(ctClass.getClassPool(), exceptions), ctClass); constructor.setModifiers(modifiers); return new JavassistConstructorInfo(null, factory, this, constructor); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }
public MutableConstructorInfo createMutableConstructor(int modifiers, Body body, String[] parameters, String[] exceptions) { try { CtConstructor constructor = CtNewConstructor.make(JavassistUtil.toCtClass(ctClass.getClassPool(), parameters), JavassistUtil.toCtClass(ctClass.getClassPool(), exceptions), body.getBody(), ctClass); constructor.setModifiers(modifiers); return new JavassistConstructorInfo(null, factory, this, constructor); } catch (CannotCompileException e) { throw new org.jboss.reflect.spi.CannotCompileException(e.toString()); } }