xbn.array
Class AOOValid

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.array.AOOValid

public class AOOValid
extends XBNObject

Ensure an array of objects is valid, according to the rules existing in an AOOVConfig. See AOOVConfig.

Source code:  AOOValid.java


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
AOOValid()
          Create a completely unrestricted AOOValid.
AOOValid(AOOVConfig aoov_config)
          Create an AOOValid.
 
Method Summary
 void crashIfBad(Object[] a_object)
          If the provided object array is invalid, throw a descriptive error message.
 void crashIfBad(String s_callingClsFnc, String s_varName, Object[] a_object)
          If the provided object array is invalid, throw a descriptive error message.
protected  void declareNoViolation()
          When extending the isValid function, you must call this immediately before your function returns true.
 AOOVConfig getAOOVConfig()
          Get the AOOVConfig for direct manipulation.
 boolean isValid(Object[] a_object)
          Is the provided array of objects legal according to the rules existing in the AOOVConfig?
 boolean isValid(String s_callingClsFnc, String s_varName, Object[] a_object)
          Is the provided array of objects legal according to the rules existing in the AOOVConfig?
protected  void throwAXBad(String s_callingClsFnc, String s_varName, String s_currently)
          Used internally, by isValid.
 boolean wasValidated()
          Was the object array validated?
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AOOValid

public AOOValid()

Create a completely unrestricted AOOValid.

Equal to AOOValid(new AOOVConfig())


AOOValid

public AOOValid(AOOVConfig aoov_config)

Create an AOOValid.

Parameters:
aoov_config - The configuration defining "valid". May not be null.
Method Detail

wasValidated

public final boolean wasValidated()

Was the object array validated?

Returns:
true If isValid was called at least once, and it returned true.
false If isValid was never called, or it was called, but returned false.

declareNoViolation

protected final void declareNoViolation()

When extending the isValid function, you must call this immediately before your function returns true.


getAOOVConfig

public final AOOVConfig getAOOVConfig()

Get the AOOVConfig for direct manipulation.

Returns:
aoov_config Exactly as provided to the constructor.

isValid

public boolean isValid(Object[] a_object)

Is the provided array of objects legal according to the rules existing in the AOOVConfig?

Returns:
isValid(null, null, a_object)

isValid

public boolean isValid(String s_callingClsFnc,
                       String s_varName,
                       Object[] a_object)

Is the provided array of objects legal according to the rules existing in the AOOVConfig?

Parameters:
s_callingClsFnc - The name of the class-dot-function for use in potential error messages only. This is the place where the error message should appear that it was generated from. For example: xbn.array.primitive.PrimitiveArrayChar.crashIfInvalid.
s_varName - The descriptive name of the char array, for potential error messages only.
a_object - The object array to analyze.
Returns:
true If all rules configured into the AOOVConfig are followed.
false If any rules are violated. Note, when either s_callingClsFnc and/or s_varName are non-null, this instead will throw an AssertException.

crashIfBad

public final void crashIfBad(Object[] a_object)

If the provided object array is invalid, throw a descriptive error message.

Equal to crashIfBad("xbn.array.AOOValid", "a_object", a_object)


crashIfBad

public final void crashIfBad(String s_callingClsFnc,
                             String s_varName,
                             Object[] a_object)

If the provided object array is invalid, throw a descriptive error message.

Equal to isValid(s_callingClsFnc, s_varName, a_object) (supressing the error message)

Note that before isValid is called, both s_callingClsFnc and s_varName are validated to be both non-null and at least one character in length.


throwAXBad

protected final void throwAXBad(String s_callingClsFnc,
                                String s_varName,
                                String s_currently)

Used internally, by isValid. See the code for isValid.




Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo