Package javassist.CtField

Examples of javassist.CtField.Initializer


      if (!isInstrumented(superclass)) {
         if (!isInstrumentable(superclass)) {
            //we're the top-most instrumentable class, so add the handler field
           CtField handlerField = new CtField(handlerClass, "handler", implementation);
           handlerField.setModifiers(Modifier.PROTECTED);
           Initializer handlerInitializer = Initializer.byCall(handlerClass, "create");
           implementation.addField(handlerField, handlerInitializer);
           CtMethod getHandlerMethod = CtNewMethod.getter("getHandler", handlerField);
           implementation.addMethod(getHandlerMethod);
         }
         else {
            //in order for the below code to make reference to the handler instance we need to
            //recursively instrument until we reach the top of the instrumentable class tree
            instrumentClass(superclass);
         }
      }

      CtField wicketComponentField = new CtField(componentClass, "component", implementation);
      wicketComponentField.setModifiers(Modifier.STATIC);
      Initializer componentInit = Initializer.byExpr("new org.jboss.seam.wicket.WicketComponent(" + className + ".class)");
      implementation.addField(wicketComponentField, componentInit);

      CtClass exception = classPool.get(Exception.class.getName());

      implementation.addInterface(getInstrumentedComponentInterface());
View Full Code Here


                if(methodKey == null) {
                    methodKey = keyGenerator.generateKey(ifaceName, method.getName(), String.valueOf(defaultValue), meaning);
                }
                CtMethod methodImpl = new CtMethod(method, impl, null);
                CtClass returnType = methodImpl.getReturnType();
                Initializer initializer;
                String valueString;
                try {
                    valueString = resBundle.getString(methodKey);
                } catch(MissingResourceException mre) {
                    if(defaultValue != null)
View Full Code Here

TOP

Related Classes of javassist.CtField.Initializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.