Examples of openParen()


Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

                code.openParen(true).openParen(true).append(name).
                    append(" == null").closeParen().append(" ? \"null\"").
                    append(": String.valueOf").openParen(true).
                    append(name).closeParen().closeParen();
            else if (type == Date.class)
                code.openParen(true).openParen(true).append(name).
                    append(" == null").closeParen().append(" ? \"null\"").
                    endl().tab(4).append(": String.valueOf").
                    openParen(true).append(name).append(".getTime").
                    parens().closeParen().closeParen();
            else
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

                append(";").endl();
            code.closeBrace(2);
            code.afterSection();

            code.tab().append("public void set").append(propName);
            code.openParen(true).append(typeName).append(" ").
                append(_fields[i].getName()).closeParen();
            code.openBrace(2).endl();
            code.tab(2).append("this.").append(_fields[i].getName()).
                append(" = ").append(_fields[i].getName()).append(";").
                endl();
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

     */
    private String getConstructor(boolean hasSuperclass) {
        CodeFormat code = newCodeFormat();
        code.tab().append("public ");
        code.append(getClassName());
        code.openParen(true).append("String str").closeParen();
        code.openBrace(2).endl();

        if (_fields.length != 0 || (hasSuperclass
            && _meta.getPrimaryKeyFields().length > 0)) {
            code.tab(2).append("fromString").openParen(true).
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

        if (_abstract || hasSuperclass)
            code.tab().append("protected ").append(toke).
                append(" fromString");
        else
            code.tab().append("private void fromString");
        code.openParen(true).append("String str").closeParen();
        code.openBrace(2).endl();

        // if we have any Object-type fields, die immediately
        for (int i = 0; i < _fields.length; i++) {
            if (_fields[i].getObjectIdFieldType() != Object.class)
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

                code.endl().tab(3).append("&& ");

            name = _fields[i].getName();
            type = _fields[i].getObjectIdFieldType();
            if (type.isPrimitive()) {
                code.openParen(false).append(name).append(" == ").
                    append("other.").append(name).closeParen();
            } else if (type == byte[].class) {
                code.openParen(false).append("equals").openParen(true).
                    append(name).append(", ").append("other.").
                    append(name).closeParen().closeParen();
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

            type = _fields[i].getObjectIdFieldType();
            if (type.isPrimitive()) {
                code.openParen(false).append(name).append(" == ").
                    append("other.").append(name).closeParen();
            } else if (type == byte[].class) {
                code.openParen(false).append("equals").openParen(true).
                    append(name).append(", ").append("other.").
                    append(name).closeParen().closeParen();
            } else if (type == char[].class) {
                // ((name == null && other.name == null)
                //  || (name != null && String.valueOf (name).
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

                //  equals (String.valueOf (other.name))))
                code.append("(").openParen(false).append(name).
                    append(" == null && other.").append(name).
                    append(" == null").closeParen().endl();
                code.tab(3).append("|| ");
                code.openParen(false).append(name).append(" != null ").
                    append("&& String.valueOf").openParen(true).append(name).
                    closeParen().append(".").endl();
                code.tab(3).append("equals").openParen(true).
                    append("String.valueOf").openParen(true).
                    append("other.").append(name).closeParen().closeParen().
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

                //  || (name != null && name.equals (other.name)))
                code.append("(").openParen(false).append(name).
                    append(" == null && other.").append(name).
                    append(" == null").closeParen().endl();
                code.tab(3).append("|| ");
                code.openParen(false).append(name).append(" != null ").
                    append("&& ").append(name).append(".equals").
                    openParen(true).append("other.").append(name).
                    closeParen().closeParen().append(")");
            }
        }
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

                code.append(name);
            else if (type == byte[].class)
                code.append("toString").openParen(true).
                    append(name).closeParen();
            else if (type == char[].class)
                code.openParen(true).openParen(true).append(name).
                    append(" == null").closeParen().append(" ? \"null\"").
                    append(": String.valueOf").openParen(true).
                    append(name).closeParen().closeParen();
            else if (type == Date.class)
                code.openParen(true).openParen(true).append(name).
View Full Code Here

Examples of org.apache.openjpa.lib.util.CodeFormat.openParen()

                append(";").endl();
            code.closeBrace(2);
            code.afterSection();

            code.tab().append("public void set").append(propName);
            code.openParen(true).append(typeName).append(" ").
                append(_fields[i].getName()).closeParen();
            code.openBrace(2).endl();
            code.tab(2).append("this.").append(_fields[i].getName()).
                append(" = ").append(_fields[i].getName()).append(";").
                endl();
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.