Package org.exolab.javasource

Examples of org.exolab.javasource.JSourceCode.indent()


        jsc.add("if (obj instanceof ");
        jsc.append(jclass.getLocalName());
        jsc.append(") {");
        jsc.add("");
        if (fields.length > 0) {
            jsc.indent();
            jsc.add(jclass.getLocalName());
            jsc.append(" temp = (");
            jsc.append(jclass.getLocalName());
            jsc.append(")obj;");
            jsc.add("boolean thcycle;");
View Full Code Here


                //-- one field since x.equals(null) should return false when equals() is
                //-- correctly implemented.
                jsc.add("if (this.");
                jsc.append(name);
                jsc.append(" != null) {");
                jsc.indent();
                jsc.add("if (temp.");
                jsc.append(name);
                jsc.append(" == null) ");
                jsc.indent();
                jsc.append("return false;");
View Full Code Here

                jsc.append(" != null) {");
                jsc.indent();
                jsc.add("if (temp.");
                jsc.append(name);
                jsc.append(" == null) ");
                jsc.indent();
                jsc.append("return false;");
                jsc.unindent();
                jsc.add("if (this.");
                jsc.append(name);
                jsc.append(" != temp.");
View Full Code Here

                jsc.append(" != temp.");
                jsc.append(name);
                jsc.append(") {");
                // This prevents string constants and improper DOM subtree self comparisons
                // (where Q(A(B)) and Q'(C(B)) are compared) screwing up cycle detection
                jsc.indent();
                jsc.add("thcycle=org.castor.core.util.CycleBreaker.startingToCycle(this." + name + ");");
                jsc.add("tmcycle=org.castor.core.util.CycleBreaker.startingToCycle(temp." + name + ");");
                // equivalent objects *will* cycle at the same time
                jsc.add("if (thcycle!=tmcycle) {");
                jsc.indent();
View Full Code Here

                jsc.indent();
                jsc.add("thcycle=org.castor.core.util.CycleBreaker.startingToCycle(this." + name + ");");
                jsc.add("tmcycle=org.castor.core.util.CycleBreaker.startingToCycle(temp." + name + ");");
                // equivalent objects *will* cycle at the same time
                jsc.add("if (thcycle!=tmcycle) {");
                jsc.indent();
                jsc.add("if (!thcycle) { org.castor.core.util.CycleBreaker.releaseCycleHandle(this."
                        + name + "); };");
                jsc.add("if (!tmcycle) { org.castor.core.util.CycleBreaker.releaseCycleHandle(temp."
                        + name + "); };");
                jsc.add("return false;");
View Full Code Here

                jsc.add("return false;");
                jsc.unindent();
                jsc.add("}"); // end of unequal cycle point test
                jsc.add("if (!thcycle) {");

                jsc.indent();

                jsc.add("if (!");
                // Special handling for comparing arrays
                if (temp.getType().isArray()) {
                    jsc.append("java.util.Arrays.equals(this.");
View Full Code Here

                    jsc.append(name);
                    jsc.append(")");
                }

                jsc.append(") {");
                jsc.indent();

                jsc.add("org.castor.core.util.CycleBreaker.releaseCycleHandle(this." + name + ");");
                jsc.add("org.castor.core.util.CycleBreaker.releaseCycleHandle(temp." + name + ");");
                jsc.add("return false;");
                jsc.unindent();
View Full Code Here

                jsc.unindent();
                jsc.add("} else if (temp.");
                jsc.append(name);
                jsc.append(" != null)");
            }
            jsc.indent();
            jsc.add("return false;");
            jsc.unindent();
        }
        jsc.add("return true;");
        jsc.unindent();
View Full Code Here

                jsc.append("+\"\\n\");");
            } else if (temp.getType().isArray()) {
                jsc.add("if (");
                jsc.append(name);
                jsc.append(" != null) {");
                jsc.indent();
                jsc.add("result.append(\"[\");");
                jsc.add("for (int i = 0; i < ");
                jsc.append(name);
                jsc.append(".length; i++) {");
                jsc.indent();
View Full Code Here

        }

        jclass.addMethod(jMethod);
        JSourceCode jsc = jMethod.getSourceCode();
        jsc.add("if ( this == obj )");
        jsc.indent();
        jsc.add("return true;");
        jsc.unindent();
        if (jclass.getSuperClassQualifiedName() != null) {
            jsc.add("");
            jsc.add("if (super.equals(obj)==false)");
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.