Examples of PlasticMethod


Examples of org.apache.tapestry5.plastic.PlasticMethod

            public void transform(PlasticClass plasticClass)
            {
                final PlasticField objectCreatorField = plasticClass.introduceField(ObjectCreator.class, "creator")
                        .inject(creator);

                PlasticMethod delegateMethod = plasticClass.introducePrivateMethod(interfaceType.getName(), "delegate",
                        null, null);

                delegateMethod.changeImplementation(new InstructionBuilderCallback()
                {
                    public void doBuild(InstructionBuilder builder)
                    {
                        builder.loadThis().getField(objectCreatorField);
                        builder.invoke(ObjectCreator.class, Object.class, "createObject");
View Full Code Here

Examples of org.apache.tapestry5.plastic.PlasticMethod

        List<PlasticMethod> result = getMethods();
        Iterator<PlasticMethod> iterator = result.iterator();

        while (iterator.hasNext())
        {
            PlasticMethod method = iterator.next();

            if (!method.hasAnnotation(annotationType))
                iterator.remove();
        }

        return result;
    }
View Full Code Here

Examples of org.apache.tapestry5.plastic.PlasticMethod

        if (Modifier.isAbstract(description.modifiers))
        {
            description = description.withModifiers(description.modifiers & ~ACC_ABSTRACT);
        }

        PlasticMethod result = description2method.get(description);

        if (result == null)
        {
            result = createNewMethod(description);
View Full Code Here

Examples of org.apache.tapestry5.plastic.PlasticMethod

    {
      /**
       * It seems that Tapestry ignores the annotation method when it is overridden
       * So we choose the cleanupRender phase as it is the method that has less chance to be annotated with @Goal 
       * */
      PlasticMethod cleanupRender = componentClass.introduceMethod(TransformConstants.CLEANUP_RENDER_DESCRIPTION);

      decorateMethodForAddingScript(componentClass, model, cleanupRender, annotation);

      model.addRenderPhase(CleanupRender.class);
    }
View Full Code Here

Examples of org.apache.tapestry5.plastic.PlasticMethod

    {
      /**
       * It seems that Tapestry ignores the method annotation when you override the method
       * So we choose to override the cleanupRender phase as it has less chance to be annotated with @Genetify 
       * */
      PlasticMethod cleanupRender = componentClass.introduceMethod(TransformConstants.CLEANUP_RENDER_DESCRIPTION);

      decorateMethodForAddingScript(componentClass, model, cleanupRender, annotation);

      model.addRenderPhase(CleanupRender.class);
    }
View Full Code Here

Examples of org.apache.tapestry5.plastic.PlasticMethod

            public void transform(PlasticClass plasticClass)
            {
                final PlasticField objectCreatorField = plasticClass.introduceField(ObjectCreator.class, "creator")
                        .injectFromInstanceContext();

                PlasticMethod delegateMethod = plasticClass.introducePrivateMethod(interfaceType.getName(), "delegate",
                        null, null);

                delegateMethod.changeImplementation(new InstructionBuilderCallback()
                {
                    public void doBuild(InstructionBuilder builder)
                    {
                        builder.loadThis().getField(objectCreatorField);
                        builder.invoke(CREATE_OBJECT);
View Full Code Here

Examples of org.apache.tapestry5.plastic.PlasticMethod

     * the two methods call each other are added.
     */
    private void addBridgeMethod(PlasticClass plasticClass, PlasticField filterField, PlasticField nextField,
                                 final MethodSignature ms, List filterMethods)
    {
        PlasticMethod method = plasticClass.introduceMethod(ms.getMethod());

        Iterator i = filterMethods.iterator();

        while (i.hasNext())
        {
            MethodSignature fms = (MethodSignature) i.next();

            int position = filterMethodAnalyzer.findServiceInterfacePosition(ms, fms);

            if (position >= 0)
            {
                bridgeServiceMethodToFilterMethod(method, filterField, nextField, position, ms, fms);
                i.remove();
                return;
            }
        }

        method.changeImplementation(new InstructionBuilderCallback()
        {
            public void doBuild(InstructionBuilder builder)
            {
                String message = String.format("Method %s has no match in filter interface %s.", ms, filterInterface.getName());

View Full Code Here

Examples of org.apache.tapestry5.plastic.PlasticMethod

    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
    {
        if (model.getComponentClassName().equals(Form.class.getName()) ||
                model.getComponentClassName().equals(FormFragment.class.getName()))
        {
            PlasticMethod setupRender = plasticClass.introduceMethod(TransformConstants.SETUP_RENDER_DESCRIPTION);

            setupRender.addAdvice(new MethodAdvice()
            {
                public void advise(MethodInvocation invocation)
                {
                    javaScriptSupport.importStack(BeanValidatorStack.STACK_ID);
View Full Code Here

Examples of org.jplastic.core.PlasticMethod

        List<PlasticMethod> result = getMethods();
        Iterator<PlasticMethod> iterator = result.iterator();

        while (iterator.hasNext())
        {
            PlasticMethod method = iterator.next();

            if (!method.hasAnnotation(annotationType))
                iterator.remove();
        }

        return result;
    }
View Full Code Here

Examples of org.jplastic.core.PlasticMethod

    public PlasticMethod introduceMethod(MethodDescription description)
    {
        check();

        PlasticMethod result = description2method.get(description);

        if (result == null)
        {
            result = createNewMethod(description);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.