EDU.bmrb.starlibj
Class StarValidity

java.lang.Object
  |
  +--EDU.bmrb.starlibj.StarValidity

public class StarValidity
extends java.lang.Object

This is a set of some simple utility methods that are used throughout the starlibj. Mostly they deal with string syntax checks. These routines are used by the starlibj functions to decide if certain operations should be rejected. (For example, deciding if a string is an acceptable saveframe name or tagname.) They are left public so that the caller of this package/library can use them too.


Constructor Summary
StarValidity()
           
 
Method Summary
static boolean isValidBlockName(java.lang.String s)
          Returns true if the string is a valid data/global block name.
static boolean isValidForDelim(java.lang.String s, int delim)
          Determines if the string given is valid for the delimiter type given (from DataValueNode).
static boolean isValidSaveName(java.lang.String s)
          Returns true if the string is a valid saveframe name.
static boolean isValidTagName(java.lang.String s)
          Returns true if the string is a valid tag name.
static boolean isValidValueForDoubleDelim(java.lang.String s)
          Returns true if the string given is valid for a double-quote delimiter in a DataValueNode.
static boolean isValidValueForFrameCodeDelim(java.lang.String s)
          Returns true if the string given is valid for a framecode delimiter (dollar sign) in a DataValueNode,
static boolean isValidValueForNonDelim(java.lang.String s)
          Returns true if the string given is valid for a nondelimited DataValueNode (no whitespace).
static boolean isValidValueForSingleDelim(java.lang.String s)
          Returns true if the string given is valid for a single-quote delimiter in a DataValueNode.
static ParseValFromRetVal parseValFrom(java.lang.String str, boolean makeNew)
          Given a string, parse (starting at the first char and extending until valid syntax is exhausted) a value string in STAR syntax.
static java.lang.String pkgName()
          Returns the String name of this package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StarValidity

public StarValidity()
Method Detail

pkgName

public static java.lang.String pkgName()
Returns the String name of this package. This is needed because Java loses the 'import' information at runtime, and therefore we have to give full-path names for types when looking at the Class object. (e.g. you can't just say:
      Class.forName("Vector")... // (won't work)
 
You have to say:
      Class.forName("java.lang.Vector")...
 
Returns:
The package name for this class.

isValidTagName

public static boolean isValidTagName(java.lang.String s)
Returns true if the string is a valid tag name.
Returns:
true if valid, false if invalid

isValidSaveName

public static boolean isValidSaveName(java.lang.String s)
Returns true if the string is a valid saveframe name.
Returns:
true if valid, false if invalid

isValidBlockName

public static boolean isValidBlockName(java.lang.String s)
Returns true if the string is a valid data/global block name.
Returns:
true if valid, false if invalid

isValidValueForNonDelim

public static boolean isValidValueForNonDelim(java.lang.String s)
Returns true if the string given is valid for a nondelimited DataValueNode (no whitespace).
Returns:
true if valid, false if invalid

isValidValueForSingleDelim

public static boolean isValidValueForSingleDelim(java.lang.String s)
Returns true if the string given is valid for a single-quote delimiter in a DataValueNode.

isValidValueForDoubleDelim

public static boolean isValidValueForDoubleDelim(java.lang.String s)
Returns true if the string given is valid for a double-quote delimiter in a DataValueNode.

isValidValueForFrameCodeDelim

public static boolean isValidValueForFrameCodeDelim(java.lang.String s)
Returns true if the string given is valid for a framecode delimiter (dollar sign) in a DataValueNode,

isValidForDelim

public static boolean isValidForDelim(java.lang.String s,
                                      int delim)
Determines if the string given is valid for the delimiter type given (from DataValueNode).
Returns:
true = valid, false = invalid.
See Also:
DataValueNode

parseValFrom

public static ParseValFromRetVal parseValFrom(java.lang.String str,
                                              boolean makeNew)
Given a string, parse (starting at the first char and extending until valid syntax is exhausted) a value string in STAR syntax.
Parameters:
str - the string to parse through.
makeNew - set to true to return a new String, false not to. Setting it to false is useful when you want to parse for the end of the string, but you don't care what the string is (you are skipping past the value.)
Returns:
The string and delimiter type in a ParseValFromRetVal structure.