Package org.apache.hivemind.service

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


        for (int i = 0; i < methods.length; i++)
        {
          Method m = methods[i];
         
            builder.clear();
            builder.begin();
            builder.add("return ($r) ");
            builder.add(indirection);
            builder.add(".");
            builder.add(m.getName());
            builder.addln("($$);");
View Full Code Here


        String functionName = support.getUniqueString("popup_window");

        BodyBuilder builder = new BodyBuilder();

        builder.addln("function {0}()", functionName);
        builder.begin();
        builder.addln(
                "var newWindow = window.open({0}, {1}, {2});",
                TapestryUtils.enquote(url),
                TapestryUtils.enquote(getWindowName()),
                TapestryUtils.enquote(getFeatures()));
View Full Code Here

                _componentMessagesSource);

        op.addField("_$messages", Messages.class);

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

    {
        String methodName = EnhanceUtils.createMutatorMethodName(propertyName);

        BodyBuilder body = new BodyBuilder();

        body.begin();

        if (persistent)
        {
            body.add("org.apache.tapestry.Tapestry#fireObservedChange(this, ");
            body.addQuoted(propertyName);
View Full Code Here

        BodyBuilder builder = new BodyBuilder();

        // Accessor

        builder.begin();
        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);
View Full Code Here

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

        // Mutator

        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
View Full Code Here

    private void addPrimitive(EnhancementOperation op, InjectSpecification spec,
            String propertyName, MethodSignature sig, String sourceName, String parser)
    {
        BodyBuilder builder = new BodyBuilder();
        builder.begin();
        builder.addln(
                "java.lang.String meta = {0}.getComponentProperty(this, \"{1}\");",
                sourceName,
                spec.getObject());
        builder.addln("return {0}(meta);", parser);
View Full Code Here

    private void addCharacterPrimitive(EnhancementOperation op, InjectSpecification spec,
            String propertyName, MethodSignature sig, String sourceName)
    {
        BodyBuilder builder = new BodyBuilder();
        builder.begin();
        builder.addln(
                "java.lang.String meta = {0}.getComponentProperty(this, \"{1}\");",
                sourceName,
                spec.getObject());
        builder.addln("return meta.charAt(0);");
View Full Code Here

    {
        String valueConverterName = op.addInjectedField("_$valueConverter", _valueConverter);
        String classRef = op.getClassReference(propertyType);

        BodyBuilder builder = new BodyBuilder();
        builder.begin();
        builder.addln(
                "java.lang.String meta = {0}.getComponentProperty(this, \"{1}\");",
                sourceName,
                spec.getObject());
        builder.addln("return ({0}) {1}.coerceValue(meta, {2});", ClassFabUtils
View Full Code Here

            String sourceField = op.addInjectedField("_$componentMessagesSource", _componentMessagesSource);

            op.addField("_$messages", Messages.class);

            BodyBuilder builder = new BodyBuilder();
            builder.begin();
            builder.addln("if (_$messages == null)");
            builder.addln("  _$messages = {0}.getMessages(this);", sourceField);
            builder.addln("return _$messages;");
            builder.end();
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.