|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject
The base class for all things xbn. Has standardized functions that throw exceptions and generate standard error messages, as well as a few other useful things.
Source code: XBNObject.java. Unit tests: xbn_junit.JUTXBNObject.java.
Field Summary | |
protected static boolean |
bFALSE_IN_PRODUCTION
Are "false" sanity checks on? |
protected static boolean |
bTRUE_IN_PRODUCTION
Are "true" sanity checks on? |
protected static String |
sCNSTR
The string 'constructor', to save a bit of memory. |
protected static String |
sES
The empty string, to save a bit of memory. |
protected static String |
sLINE_SEP
The line separator appropriate for this environment. |
Constructor Summary | |
XBNObject()
|
Method Summary | |
static String |
getXMsgPrefix()
Get the prefix used in exception messages. |
protected static void |
sop(String s_message)
Print a line of output to standard out. |
protected static void |
sopl()
Print a newline only to standard out. |
protected static void |
sopl(String s_message)
Print a line of output to standard out. |
protected void |
throwAX(String s_funcMsg)
Throw an AssertException. |
protected void |
throwAXIfBadStr(String s_tr,
String s_stringName,
String s_callingFunc)
If the provided String is null or zero characters in length, throw an exception. |
protected void |
throwAXIfNull(Object o_bject,
String s_objectName,
String s_callingFunc)
If the provided Object is null, throw an exception. |
protected void |
throwAXSpoof(String s_classFuncMsg)
Throw an AssertException. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final boolean bTRUE_IN_PRODUCTION
Are "true" sanity checks on?
During development only, when extra checks are desired to ensure things are working as they should, set this to false. Must be true in production.
Note: There are also some select "SANITY CHECK"-s throughout the xbn packages that need to be commented out during production.
Equal to true
protected static final boolean bFALSE_IN_PRODUCTION
Are "false" sanity checks on?
During development only, when extra checks are desired to ensure things are working as they should, set this to true. Must be false in production.
Note: There are also some select "SANITY CHECK"-s throughout the xbn packages that need to be commented out during production.
Equal to false
protected static final String sLINE_SEP
The line separator appropriate for this environment.
Hardcoding "\n" (for instance) into your class' strings is not portable. This is.
Equal to System.getProperty("line.separator", "\n")
protected static final String sES
The empty string, to save a bit of memory. Use this instead of creating an empty string explicitely.
Equal to ""
protected static final String sCNSTR
The string 'constructor', to save a bit of memory. Use this instead of creating the string explicitely. There is no need to use this except when creating a string entirely equaling 'constructor'.
Constructor Detail |
public XBNObject()
Method Detail |
protected static final void sopl(String s_message)
Print a line of output to standard out.
Equal to System.out.println(s_message)
s_message
- The message to output.protected static final void sop(String s_message)
Print a line of output to standard out.
Equal to System.out.print(s_message)
s_message
- The message to output.protected static final void sopl()
protected final void throwAX(String s_funcMsg)
Throw an AssertException.
Equal to throwAXSpoof(this.getClass().getName() + "." + s_funcMsg)
protected final void throwAXSpoof(String s_classFuncMsg)
Throw an AssertException.
Equal to throw new AssertException(getXMsgPrefix() + s_classFuncMsg)
s_classFuncMsg
- The name of the calling class, calling function, and the body of the error message.protected final void throwAXIfNull(Object o_bject, String s_objectName, String s_callingFunc)
If the provided Object is null, throw an exception.
If o_bject is non-null, then this function does nothing. Otherwise, this is equal to
throwAX(s_callingFunc + ": " + s_objectName + " is null.")
o_bject
- The Object to analyze for null-ness.s_objectName
- The name of the object, for the potential error message only.s_callingFunc
- The name of the function from which the (potential) error message should appear that it is being thrown from.protected final void throwAXIfBadStr(String s_tr, String s_stringName, String s_callingFunc)
If the provided String is null or zero characters in length, throw an exception.
If s_tr is non-null and at least one character in length, then this function does nothing. Otherwise, an exception is thrown, describing the specific error.
s_tr
- The string to analyze for null-ness and empty-ness.s_stringName
- The name of the string, for the potential error message only.s_callingFunc
- The name of the function from which the (potential) error message should appear that it is being thrown from.public static final String getXMsgPrefix()
Get the prefix used in exception messages.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava