Package org.exolab.castor.types

Examples of org.exolab.castor.types.Date


            System.out.println();

            System.out.println();
            System.out.println("Shipping Date:");
            ShippingDate date = invoice.getShippingDate();
            Date day = date.getDate();
            Time time = date.getTime();

            System.out.println("   Date :" + day.toString());
            System.out.println("   Time :" + time.toString());
            System.out.println();

            System.out.println("----End of Invoice----");
            invoice.marshal(new FileWriter("invoice2.xml"));
View Full Code Here


   
    jsc.add("DateTimeValidator typeValidator = new DateTimeValidator();");
    if (hasMinimum()) {
      jsc.add("try {");
      jsc.indent();
      Date min = getMinExclusive();
      if (min != null) {
        jsc.add(
          "org.exolab.castor.types.Date min ="
            + "org.exolab.castor.types.Date.parseDate("
            + "\""
            + min.toString()
            + "\");");
        jsc.add("typeValidator.setMinExclusive(");
      } else {
        min = getMinInclusive();
        jsc.add(
          "org.exolab.castor.types.Date min ="
            + "org.exolab.castor.types.Date.parseDate("
            + "\""
            + min.toString()
            + "\");");
        jsc.add("typeValidator.setMinInclusive(");
      }
      jsc.append("min");
      jsc.append(");");
      jsc.unindent();
      jsc.add("} catch (java.text.ParseException e) {");
      jsc.indent();
      jsc.add("System.out.println(e);");
      jsc.add("e.printStackTrace();");
      jsc.add("return;");
      jsc.unindent();
      jsc.add("}");

    } //hasMinimum?

    if (hasMaximum()) {
      jsc.add("try {");
      jsc.indent();
      Date max = getMaxExclusive();
      if (max != null) {
        jsc.add(
          "org.exolab.castor.types.Date max ="
            + "org.exolab.castor.types.Date.parseDate("
            + "\""
            + max.toString()
            + "\");");
        jsc.add("typeValidator.setMaxExclusive(");
      } else {
        max = getMaxInclusive();
        jsc.add(
          "org.exolab.castor.types.Date max ="
            + "org.exolab.castor.types.Date.parseDate("
            + "\""
            + max.toString()
            + "\");");
        jsc.add("typeValidator.setMaxInclusive(");
      }
      jsc.append("max");
      jsc.append(");");
View Full Code Here

   
    jsc.add("DateTimeValidator typeValidator = new DateTimeValidator();");
    if (hasMinimum()) {
      jsc.add("try {");
      jsc.indent();
      Date min = getMinExclusive();
      if (min != null) {
        jsc.add(
          "org.exolab.castor.types.Date min ="
            + "org.exolab.castor.types.Date.parseDate("
            + "\""
            + min.toString()
            + "\");");
        jsc.add("typeValidator.setMinExclusive(");
      } else {
        min = getMinInclusive();
        jsc.add(
          "org.exolab.castor.types.Date min ="
            + "org.exolab.castor.types.Date.parseDate("
            + "\""
            + min.toString()
            + "\");");
        jsc.add("typeValidator.setMinInclusive(");
      }
      jsc.append("min");
      jsc.append(");");
      jsc.unindent();
      jsc.add("} catch (java.text.ParseException e) {");
      jsc.indent();
      jsc.add("System.out.println(e);");
      jsc.add("e.printStackTrace();");
      jsc.add("return;");
      jsc.unindent();
      jsc.add("}");

    } //hasMinimum?

    if (hasMaximum()) {
      jsc.add("try {");
      jsc.indent();
      Date max = getMaxExclusive();
      if (max != null) {
        jsc.add(
          "org.exolab.castor.types.Date max ="
            + "org.exolab.castor.types.Date.parseDate("
            + "\""
            + max.toString()
            + "\");");
        jsc.add("typeValidator.setMaxExclusive(");
      } else {
        max = getMaxInclusive();
        jsc.add(
          "org.exolab.castor.types.Date max ="
            + "org.exolab.castor.types.Date.parseDate("
            + "\""
            + max.toString()
            + "\");");
        jsc.add("typeValidator.setMaxInclusive(");
      }
      jsc.append("max");
      jsc.append(");");
View Full Code Here

        System.out.println();

        System.out.println();
      System.out.println("Shipping Date:");
        ShippingDate date = invoice.getShippingDate();
        Date day = date.getDate();
        Time time = date.getTime();

        System.out.println("   Date :"+day.toString());
        System.out.println("   Time :"+time.toString());
      System.out.println();

        System.out.println("----End of Invoice----");
        invoice.marshal(new FileWriter("invoice2.xml"));
View Full Code Here

TOP

Related Classes of org.exolab.castor.types.Date

Copyright © 2018 www.massapicom. 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.