Package java.text

Examples of java.text.Format.format()


      return cachedResult;
    }

    try
    {
      cachedResult = f.format(o);
    }
    catch (IllegalArgumentException e)
    {
      cachedResult = getNullValue();
    }
View Full Code Here


      else
      {
        if (getLog().isDebugEnabled())
        {
          Format formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          getLog().debug("- MagicDraw model file ["+sourceFile.getName()+"] date = " + formatter.format(new Date(sourceFile.lastModified())));
          getLog().debug("- EMF model file ["+destFile.getName()+"] date = " + formatter.format(new Date(destFile.lastModified())));
        }
        if (destFile.lastModified() >= sourceFile.lastModified())
        {
          getLog().info("Model file [" + dest + "] is up-to-date");
View Full Code Here

      {
        if (getLog().isDebugEnabled())
        {
          Format formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          getLog().debug("- MagicDraw model file ["+sourceFile.getName()+"] date = " + formatter.format(new Date(sourceFile.lastModified())));
          getLog().debug("- EMF model file ["+destFile.getName()+"] date = " + formatter.format(new Date(destFile.lastModified())));
        }
        if (destFile.lastModified() >= sourceFile.lastModified())
        {
          getLog().info("Model file [" + dest + "] is up-to-date");
          return;
View Full Code Here

    else
    {
      Format format = getFormat();
      if (format != null)
      {
        textFieldValue = format.format(textFieldValue);
      }
    }

    String oldRawText = getRawText();
    String newRawText = processMarkupText(String.valueOf(textFieldValue));
View Full Code Here

   
    if(object == null) return field + " is null and could not be formatted.";
    if(format == null) return object.toString();
   
    try {
      return format.format(object);
    } catch(Exception q) {
      return "Formatting error: " + q.getMessage();
    }
  }
 
View Full Code Here

        // should return the Date according to the provided format

        if (SynapseConstants.SYSTEM_DATE.equals(key)) {
            if (dateformat != null) {
                Format formatter = new SimpleDateFormat(dateformat.toString());
                return formatter.format(new java.util.Date());
            } else {
                Format formatter = new SimpleDateFormat();
                return formatter.format(new java.util.Date());
            }
        }
View Full Code Here

            if (dateformat != null) {
                Format formatter = new SimpleDateFormat(dateformat.toString());
                return formatter.format(new java.util.Date());
            } else {
                Format formatter = new SimpleDateFormat();
                return formatter.format(new java.util.Date());
            }
        }

        //return the current system time as a string , don't care scope
        if (SynapseConstants.SYSTEM_TIME.equals(key)) {
View Full Code Here

            }
        }
        GraphJS += "graph" + graph_id + ".addAxis(\"x\", {labels: [";
        for (int i = 1; i < dataSet1.size(); i++) {
            Date date = new Date((Long) snapshotTimes.get(i));
            GraphJS += "{value: " + (i) + ", text: '" + formatter.format(date)
                    + "' }, \n";
        }
        GraphJS += "]});\n";
        GraphJS += "graph" + graph_id + ".addAxis(\"y\", {vertical: true});\n";
View Full Code Here

            }
        }
        GraphJS += "graph" + graph_id + ".addAxis(\"x\", {labels: [";
        for (int i = 1; i < dataSet1.size(); i++) {
            Date date = new Date((Long) snapshotTimes.get(i));
            GraphJS += "{value: " + (i) + ", text: '" + formatter.format(date)
                    + "' }, \n";
        }
        GraphJS += "]});\n";
        GraphJS += "graph" + graph_id + ".addAxis(\"y\", {vertical: true});\n";
View Full Code Here

        // established
        // so we need to update the last_seen attribute for the server
        Format formatter = null;
        formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date(System.currentTimeMillis());
        String currentTime = formatter.format(date);

        Connection conn = DBManager.createConnection();
        try {
            Statement stmt = conn.createStatement();
            stmt.executeUpdate("UPDATE SERVERS SET LAST_SEEN = '" + currentTime
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.