Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Name format limitations ...

Some of our user data comes in tagged with human readable names (eg.,
with spaces) which we'd like to maintain as is, but which causes
problems for RealType/ScalarType objects when they hit validateName().
I guess the question is why are there "reserved" characters for the
RealType/ScalarType name String's, or alternatively, what would break if
a name were just any String?

Would this work and are there hidden effects???


  /**
   * Throw a <CODE>TypeException</CODE> if the name is invalid.
   *
   * @param name Name to check.
   * @param type Type used in exception message.
   *
   * @exception TypeException If there is a problem with the name.
   */
  public static synchronized void validateName(String name, String type)
    throws TypeException
  {
    if (name == null) {
      throw new TypeException("ScalarType: " + type + " cannot be
null");
    }
//    if (name.indexOf(".") > -1 ||
//        name.indexOf(" ") > -1 ||
//        name.indexOf("(") > -1 ||
//        name.indexOf(")") > -1) {
//      throw new TypeException("ScalarType: " + type + " cannot contain
" +
//                              "space . ( or ) " + name);
//    }
    if (getScalarTypeByName(name) != null) {
      throw new TypeException("ScalarType: " + type + " already used");
    }
    if (Translations.containsKey(name)) {
      throw new TypeException("ScalarType: " + type + " already used" +
                              " as an alias");
    }
  }

thanks...  dlf

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690