Package org.apache.ws.jaxme.js

Examples of org.apache.ws.jaxme.js.JavaMethod.addEndIf()


   }
   getInstanceByValue.addElse();
   getInstanceByValue.addLine("throw new ", IllegalArgumentException.class, "(",
                      JavaSource.getQuoted("Invalid name: "),
                      " + pValue);");
   getInstanceByValue.addEndIf();

   if (isAddingEquals()) {
     JavaMethod equals = pSource.newJavaMethod("equals", JavaQNameImpl.BOOLEAN,
                                               JavaSource.PUBLIC);
     equals.addParam(Object.class, "o");
View Full Code Here


     JavaMethod equals = pSource.newJavaMethod("equals", JavaQNameImpl.BOOLEAN,
                                               JavaSource.PUBLIC);
     equals.addParam(Object.class, "o");
     equals.addIf("o == null  ||  !(o instanceof ", pSource.getQName(), ")");
     equals.addLine("return false;");
     equals.addEndIf();
     equals.addLine("return name.equals(((", pSource.getQName(), ") o).name);");

      JavaMethod hashCode = pSource.newJavaMethod("hashCode", JavaQNameImpl.INT,
                                                  JavaSource.PUBLIC);
      hashCode.addLine("return name.hashCode();");
View Full Code Here

    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pValue = jm.addParam(String.class, "pValue");
    jm.addThrows(SAXException.class);
    jm.addIf(pURI, " == null");
    jm.addLine(pURI, " = \"\";");
    jm.addEndIf();
   
    JavaQName resultType = ctSG.getClassContext().getXMLInterfaceName();
    LocalJavaField result = jm.newJavaField(resultType);
    result.addLine("(", resultType, ") result");
View Full Code Here

        TypedValue v = createSimpleTypeConversion(jm, myAttributes[i].getTypeSG(), pValue, "@" + myAttributes[i].getName());
        attr.getPropertySG().setValue(jm, result, v, null);
        jm.addLine("return;");
      }
      if (!firstInNamespace) {
        jm.addEndIf();
      }
    }
    if (!first) {
      jm.addEndIf();
    }
View Full Code Here

      if (!firstInNamespace) {
        jm.addEndIf();
      }
    }
    if (!first) {
      jm.addEndIf();
    }
   
    AttributeSG wildcard = null;
    for (int i = 0;  i < myAttributes.length;  i++) {
      if (myAttributes[i].isWildcard()) {
View Full Code Here

      o.addLine(list, ".get(", list, ".size()-1)");
      jm.addIf(o, " instanceof ", String.class);
      jm.addLine(list, ".set(", list, ".size()-1, ",
             "((", String.class, ") ", o, ") + ", s, ");");
      jm.addLine("return;");
      jm.addEndIf();
      jm.addEndIf();
      jm.addLine(list, ".add(", s, ");");
    }
    return jm;
  }
View Full Code Here

      jm.addIf(o, " instanceof ", String.class);
      jm.addLine(list, ".set(", list, ".size()-1, ",
             "((", String.class, ") ", o, ") + ", s, ");");
      jm.addLine("return;");
      jm.addEndIf();
      jm.addEndIf();
      jm.addLine(list, ".add(", s, ");");
    }
    return jm;
  }
View Full Code Here

    pValue = fromValueMethod.addParam(valueType, "pValue");
    fromValueMethod.setStatic(true);
    DirectAccessible i = fromValueMethod.addForArray(instances);
    fromValueMethod.addIf(pController.getEqualsCheck(fromValueMethod, new Object[]{instances, "[", i, "].value"}, pValue));
    fromValueMethod.addLine("return ", instances, "[", i, "];");
    fromValueMethod.addEndIf();
    fromValueMethod.addEndFor();
    fromValueMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid value: "),
                                " + ", pValue);

    JavaMethod fromNameMethod = js.newJavaMethod("fromName", qName, JavaSource.PUBLIC);
View Full Code Here

    pName = fromNameMethod.addParam(String.class, "pName");
    fromNameMethod.setStatic(true);
    i = fromNameMethod.addForArray(instances);
    fromNameMethod.addIf(instances, "[", i, "].name.equals(", pName, ")");
    fromNameMethod.addLine("return ", instances, "[", i, "];");
    fromNameMethod.addEndIf();
    fromNameMethod.addEndFor();
    fromNameMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid name: "),
                                " + ", pName);

    JavaMethod fromStringMethod = js.newJavaMethod("fromString", qName, JavaSource.PUBLIC);
View Full Code Here

    {
      JavaMethod getPropertyMethod = js.newJavaMethod("getProperty", Object.class, "public");
      Parameter pName = getPropertyMethod.addParam(String.class, "pName");
      getPropertyMethod.addIf(properties, " == null");
      getPropertyMethod.addLine("return null;");
      getPropertyMethod.addEndIf();
      getPropertyMethod.addLine("return ", properties, ".get(", pName, ");");
    }

    {
      JavaMethod setPropertyMethod = js.newJavaMethod("setProperty", void.class, "public");
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.