***  This API provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.util
Class Names

java.lang.Object
  |
  +--com.sas.services.util.Names

public class Names
extends Object

Utility classes needed to support consistent naming behavior.

Since:
1.1.3

Field Summary
static int UNIX
          UNIX operating system.
static int UNKNOWN
          Unknown operating system.
static int WEBDAV
          WebDAV
static int WINDOWS
          Windows operating system.
static int ZOS_HFS
          z/OS HFS operating system.
static int ZOS_PDS
          z/OS PDS operating system.
 
Method Summary
static String mapNameToFilesystem(String name, int hostOS, String prefix, String suffix)
          Map the object name to a file system path.
static String mapNameToSASVariableName(String name, Collection existingNames)
          Map the parameter name to a valid SAS variable name.
static String mapUrlToFilesystem(String url, int hostOS, String prefix, String suffix)
          Map the object SBIP URLto a file system path.
static String trimName(String name)
          Trim leading and trailing space and control characters.
static boolean validateOMRObjectName(String name, boolean throwException)
          Test for a valid Metadata Repository object name.
static boolean validateParameterName(String name, boolean throwException)
          Test for valid parameter name or parameter group name.
static boolean validateSASVariableName(String name, boolean throwException)
          Test for valid SAS variable name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
Unknown operating system.

WINDOWS

public static final int WINDOWS
Windows operating system.

UNIX

public static final int UNIX
UNIX operating system.

ZOS_HFS

public static final int ZOS_HFS
z/OS HFS operating system.

ZOS_PDS

public static final int ZOS_PDS
z/OS PDS operating system.

WEBDAV

public static final int WEBDAV
WebDAV
Method Detail

mapNameToFilesystem

public static String mapNameToFilesystem(String name,
                                         int hostOS,
                                         String prefix,
                                         String suffix)
                                  throws IllegalArgumentException
Map the object name to a file system path.
Parameters:
name - The name to map to a file system path.
hostOS - The host operating system. Valid values include UNKNOWN,WINDOWS,UNIX, ZOS_HFS,ZOS_PDSand WEBDAV.
prefix - The prefix to use when creating the file system path.
suffix - The suffix to use when creating the file system path.
Returns:
String The file system path.
Throws:
IllegalArgumentException - If a null name is specified or if an invalid host operating system value is specified.

mapUrlToFilesystem

public static String mapUrlToFilesystem(String url,
                                        int hostOS,
                                        String prefix,
                                        String suffix)
                                 throws IllegalArgumentException
Map the object SBIP URLto a file system path.
Parameters:
url - The url to map to a file system path.
hostOS - The host operating system. Valid values include UNKNOWN,WINDOWS,UNIX, ZOS_HFS,ZOS_PDSand WEBDAV.
prefix - The prefix to use when creating the file system path.
suffix - The suffix to use when creating the file system path.
Returns:
String The file system path.
Throws:
IllegalArgumentException - If an invalid SBIP URL is specified.

mapNameToSASVariableName

public static String mapNameToSASVariableName(String name,
                                              Collection existingNames)
                                       throws IllegalArgumentException
Map the parameter name to a valid SAS variable name. The rules for conversion are as follows:
Parameters:
name - The name to map to a SAS variable name.
existingNames - Is an optional collection containingg all pre-existing parameters so that the method can avoid name collisions. A value of null for this Collection would disable any name collision checking.
Returns:
String the SAS variable name.
Throws:
IllegalArgumentException - If a null name is specified.

validateOMRObjectName

public static boolean validateOMRObjectName(String name,
                                            boolean throwException)
                                     throws IllegalArgumentException
Test for a valid Metadata Repository object name. The rules for validating are as follows. The object name is invalid if any of the following are true:
Parameters:
name - The name to validate
throwException - indicates whether to throw an exception if the value is not valid.
Returns:
boolean is true if this is a valid name; is false if the name contains an illegal character or is too long.
Throws:
IllegalArgumentException - If the throwException parameter is true and the name is invalid.

validateParameterName

public static boolean validateParameterName(String name,
                                            boolean throwException)
                                     throws IllegalArgumentException
Test for valid parameter name or parameter group name. The rules for validating are as follows. The parameter name is invalid if any of the following are true:
Parameters:
name - The name to validate.
throwException - indicates whether to throw an exception if the value is not valid.
Returns:
boolean is true if this is a valid name; is false if the name contains an illegal character or is too long.
Throws:
IllegalArgumentException - If the throwException parameter is true and the name is invalid.

validateSASVariableName

public static boolean validateSASVariableName(String name,
                                              boolean throwException)
                                       throws IllegalArgumentException
Test for valid SAS variable name. The rules for validating are as follows. The variable name is invalid if any of the following are true:
Parameters:
name - The SAS variable name to validate.
throwException - indicates whether to throw an exception if the value is not valid.
Returns:
boolean is true if this is a valid name; is false if the name contains an illegal character or is too long.
Throws:
IllegalArgumentException - If the throwException parameter is code>true and the name is invalid.

trimName

public static String trimName(String name)
                       throws IllegalArgumentException
Trim leading and trailing space and control characters. Whitespace identified by the Character.isSpaceChar method will be trimmed. Control characters identified by the Character.isISOControl method will be trimmed.
Parameters:
name - The name to trim.
Returns:
String The trimmed name.
Throws:
IllegalArgumentException - If a null name is specified.

***  This API provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:29:04