Community articleisValidFormat method
Added by IBM contributorIBM on May 2, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This method returns the boolean result of whether a string is valid according to the setting of the node's format option.


   public boolean isValidFormat(
      String theString
   ) throws UWIException;


Table 1. Method parameters
A string to be checked against the format. For example, to check 23.2 against a specific format, the string would be “23.2”.


True if the string does match the format, false if it does not.


The following function locates the Currency field and checks to see if “23.2” conforms to the format required by the field's format option.
   public boolean checkFormat(formNodeP theForm) 
      throws Exception
   FormNodeP theItem;
      /* Locate the Currency field */
      if ((theItem = theForm.dereferenceEx(null, "PAGE1.Currency", 0, _
         FormNodeP.UFL_OPTION_REFERENCE, null)) == null)
         throw new UWIException("Could not locate the Currency node.");
      /* Check the string to see if it is invalid*/
      (theItem.isValidFormat("23.2") == false)
         throw new UWIException("The value is not correctly formatted.");
          System.out.println("The value is formatted correctly.");

Parent topic:
FormNodeP class