Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.BodyBuilder.end()


            builder.add("return ($r) ");
            builder.add(indirection);
            builder.add(".");
            builder.add(m.getName());
            builder.addln("($$);");
            builder.end();

            _classFab.addMethod(Modifier.PUBLIC, new MethodSignature(m), builder.toString());

            toString |= ClassFabUtils.isToString(m);
        }
View Full Code Here


                "var newWindow = window.open({0}, {1}, {2});",
                TapestryUtils.enquote(url),
                TapestryUtils.enquote(getWindowName()),
                TapestryUtils.enquote(getFeatures()));
        builder.addln("newWindow.focus();");
        builder.end();

        support.addBodyScript(component, builder.toString());

        return "javascript:" + functionName + "();";
    }
View Full Code Here

        BodyBuilder builder = new BodyBuilder();
        builder.begin();
        builder.addln("if (_$messages == null)");
        builder.addln("  _$messages = {0}.getMessages(this);", sourceField);
        builder.addln("return _$messages;");
        builder.end();

        op.addMethod(Modifier.PUBLIC, _methodSignature, builder.toString(), location);
    }

    public void setComponentMessagesSource(ComponentMessagesSource componentMessagesSource)
View Full Code Here

            body.addln(", ($w) $1);");
        }

        body.addln(fieldName + " = $1;");

        body.end();

        MethodSignature sig = new MethodSignature(void.class, methodName,
                new Class[] { propertyType }, null);

        op.addMethod(Modifier.PUBLIC, sig, body.toString(), location);
View Full Code Here

        builder.addln("if ({0} == null)", fieldName);
        builder.addln("  {0} = ({1}) {2}.get(\"{3}\");", new Object[] {
                fieldName, ClassFabUtils.getJavaClassName(propertyType),
                managerField, objectName });
        builder.addln("return {0};", fieldName);
        builder.end();

        String methodName = op.getAccessorMethodName(propertyName);

        MethodSignature sig = new MethodSignature(propertyType, methodName,
                null, null);
View Full Code Here

        builder.clear();
        builder.begin();
        builder.addln("{0}.store(\"{1}\", $1);", managerField, objectName);
        builder.addln("{0} = $1;", fieldName);
        builder.end();

        sig = new MethodSignature(void.class, EnhanceUtils
                .createMutatorMethodName(propertyName),
                new Class[] { propertyType }, null);
View Full Code Here

        builder.addln(
                "java.lang.String meta = {0}.getComponentProperty(this, \"{1}\");",
                sourceName,
                spec.getObject());
        builder.addln("return {0}(meta);", parser);
        builder.end();

        op.addMethod(Modifier.PUBLIC, sig, builder.toString());
    }

    private void addCharacterPrimitive(EnhancementOperation op, InjectSpecification spec,
View Full Code Here

        builder.addln(
                "java.lang.String meta = {0}.getComponentProperty(this, \"{1}\");",
                sourceName,
                spec.getObject());
        builder.addln("return meta.charAt(0);");
        builder.end();

        op.addMethod(Modifier.PUBLIC, sig, builder.toString());
    }

    private void addObject(EnhancementOperation op, InjectSpecification spec, String propertyName,
View Full Code Here

                "java.lang.String meta = {0}.getComponentProperty(this, \"{1}\");",
                sourceName,
                spec.getObject());
        builder.addln("return ({0}) {1}.coerceValue(meta, {2});", ClassFabUtils
                .getJavaClassName(propertyType), valueConverterName, classRef);
        builder.end();

        op.addMethod(Modifier.PUBLIC, sig, builder.toString());
    }

    public void setSource(ComponentPropertySource source)
View Full Code Here

            BodyBuilder builder = new BodyBuilder();
            builder.begin();
            builder.addln("if (_$messages == null)");
            builder.addln("  _$messages = {0}.getMessages(this);", sourceField);
            builder.addln("return _$messages;");
            builder.end();

            op.addMethod(Modifier.PUBLIC, METHOD_SIGNATURE, builder.toString());
        }
        catch (Exception ex)
        {
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.