|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.spatial.SpatialManager
public class SpatialManager
SpatialManager contains convenience methods for managing geometry objects.
SpatialManager implements a logging facade. An application can activate
logging by using the methods setLogWriter
and
setLogLevel
.
This class also implements error message formatting and reporting.
SpatialManager is safe for concurrent access by multiple threads.
Constructor Summary | |
---|---|
SpatialManager()
|
Method Summary | |
---|---|
static void |
assertSM(boolean cond,
java.lang.String className,
java.lang.String methodName)
Assertion failure reporting. |
static void |
assertSM(boolean cond,
java.lang.String className,
java.lang.String methodName,
int id)
Assertion failure reporting. |
static java.lang.String |
buildNumber()
Returns a product build number. |
static java.lang.String |
buildTime()
Returns a product build date and time string (non-localized!) |
static java.lang.String |
buildVersion()
Returns a product build version string. |
static ErrorHandler |
getErrorHandler()
Returns the current error handler. |
static ErrorReporter |
getErrorReporter()
Returns the current error reporter. |
static EventLocation |
getEventLocation(java.lang.String className,
java.lang.String methodName)
Returns a code locator to use when reporting errors. |
static java.util.Locale |
getLocale()
Note: this method is used internally and may be changed in future implementations without notice. |
static Logger |
getLogger()
Returns the current logger. |
static LogHandler |
getLogHandler()
Returns the cuurent log handler. |
static int |
getLogLevel()
Returns the current logging level. |
static java.io.Writer |
getLogWriter()
Returns the current log Writer. |
static MessageProvider |
getMessageProvider()
Returns the current message provider. |
static void |
indexOutOfRange(java.lang.String idxName,
int idxValue,
int minValue,
int maxValue,
java.lang.String className,
java.lang.String methodName)
Prepares an error message and reports an index out of range error. |
static void |
invalidArg(java.lang.String argName,
int argValue,
java.lang.String className,
java.lang.String methodName)
Prepares an error message and reports an invalid argument error. |
static void |
invalidArg(java.lang.String argName,
java.lang.String argValue,
java.lang.String className,
java.lang.String methodName)
Prepares an error message and reports an invalid argument error. |
static java.lang.String |
releaseVersion()
Returns a product release version string. |
static void |
reportError(java.lang.Exception exception,
java.lang.String className,
java.lang.String methodName)
Report an error caused by exception . |
static void |
reportError(int msgCode)
Report a fatal error with a message indicated by msgCode. |
static void |
reportError(int msgCode,
int errorType,
java.lang.Object[] args,
EventLocation location)
Report an error of type errorType. |
static void |
reportError(int msgCode,
java.lang.Object[] args)
Report a fatal error. |
static void |
reportError(int msgCode,
java.lang.Object[] args,
EventLocation location)
Report a fatal error. |
static void |
reportError(int msgCode,
java.lang.Object[] args,
java.lang.String className,
java.lang.String methodName)
Report a fatal error. |
static void |
reportError(int msgCode,
java.lang.String className,
java.lang.String methodName)
Report a fatal error. |
static void |
setErrorHandler(ErrorHandler handler)
Sets the error handler. |
static void |
setLocale(java.util.Locale locale)
Note: this method is used internally and may be changed in future implementations without notice. |
static void |
setLogger(Logger logger)
Sets the current logger. |
static void |
setLogLevel(int level)
Sets the current logging level. |
static void |
setLogWriter(java.lang.String fileName)
Sets the current log Writer. |
static void |
setLogWriter(java.io.Writer writer)
Sets the current log Writer. |
static void |
unsupported()
Prepares an error message and reports an unsupported operation error. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpatialManager()
Method Detail |
---|
public static void setLocale(java.util.Locale locale) throws SpatialException
Note: this method is used internally and may be changed in future implementations without notice. Applications should not use this method.
locale
- A Java Locale object.
SpatialException
- Throws an exception
(using the previous or default locale) if the requested
locale is not supported.SpatialException
public static java.util.Locale getLocale()
Note: this method is used internally and may be changed in future implementations without notice. Applications should not use this method.
public static void setErrorHandler(ErrorHandler handler)
handler
- The new error handler.public static ErrorHandler getErrorHandler()
setErrorHandler(com.ibm.spatial.ErrorHandler)
public static MessageProvider getMessageProvider()
public static void setLogger(Logger logger)
Note: this method is used internally and may be changed in future implementations without notice. Applications should not use this method.
logger
- A new logger to be registered with this SpatialManager.getLogger()
public static Logger getLogger()
setLogger(com.ibm.spatial.util.Logger)
public static void setLogLevel(int level)
level
- the logging levelLogger
public static int getLogLevel()
setLogLevel(int)
public static LogHandler getLogHandler()
Note: this method is used internally and may be changed in future implementations without notice. Applications should not use this method.
public static void setLogWriter(java.lang.String fileName) throws java.io.IOException
fileName
- A name for the log file. If fileName is null, then
the log is written to the standard error stream
with the default character encoding.
java.io.IOException
- if the specified file can't be opened or if
some other I/O error occurs.getLogWriter()
public static void setLogWriter(java.io.Writer writer)
writer
- an object extending java.io.WritergetLogWriter()
public static java.io.Writer getLogWriter()
setLogWriter(java.lang.String)
public static ErrorReporter getErrorReporter()
Note: this method is used internally and may be changed in future implementations without notice. Applications should not use this method.
public static void reportError(java.lang.Exception exception, java.lang.String className, java.lang.String methodName) throws SpatialException
exception
. If logging is
turned on, the exception is logged at a Logger.SEVERE level, then
the exception is thrown.
exception
- The exception generated by the caller.className
- The name of the class where the error occurredmethodName
- The name of the method where the error occurred
SpatialException
- a SpatialException wrapping the exception
passed as argumentpublic static void reportError(int msgCode) throws SpatialException
msgCode
- The error message code
SpatialException
- A SpatialException is thrown on error.public static void reportError(int msgCode, java.lang.Object[] args) throws SpatialException
msgCode
- The error message codeargs
- Arguments for error message text
SpatialException
- A SpatialException is thrown on error.public static void reportError(int msgCode, java.lang.String className, java.lang.String methodName) throws SpatialException
msgCode
- The error message codeclassName
- The class name where the error occurredmethodName
- The method name where the error occurred
SpatialException
- A SpatialException is thrown on error.public static void reportError(int msgCode, java.lang.Object[] args, java.lang.String className, java.lang.String methodName) throws SpatialException
msgCode
- The error message codeargs
- Arguments for error message textclassName
- The class name where the error occurredmethodName
- The method name where the error occurred
SpatialException
- A SpatialException is thrown on error.public static void reportError(int msgCode, java.lang.Object[] args, EventLocation location) throws SpatialException
msgCode
- The error message codeargs
- Arguments for error message textlocation
- The error location information
SpatialException
- A SpatialException is thrown on error.public static void reportError(int msgCode, int errorType, java.lang.Object[] args, EventLocation location) throws SpatialException
An error may be of one of the following types:
msgCode
- The error message codeerrorType
- The type of the error. An error type can be:args
- Arguments for error message textlocation
- The error location information
SpatialException
- A SpatialException is thrown on error.public static void assertSM(boolean cond, java.lang.String className, java.lang.String methodName, int id)
cond
- a boolean expression which is asserted to be true;
if false, then a SpatialException with error code
Messages.MSG_ASSERT_FAILURE_WITH_ID is thrownclassName
- the class namemethodName
- the method nameid
- a numerical id, to identify several assertions in
a single method.
java.lang.RuntimeException
public static void assertSM(boolean cond, java.lang.String className, java.lang.String methodName)
cond
- a boolean expression which is asserted to be true;
if false, then a SpatialException with error code
Messages.MSG_ASSERT_FAILURE_WITH_ID is thrownclassName
- the class namemethodName
- the method name
java.lang.RuntimeException
public static void indexOutOfRange(java.lang.String idxName, int idxValue, int minValue, int maxValue, java.lang.String className, java.lang.String methodName)
idxName
- the name of the indexidxValue
- the value of the indexminValue
- the minimum legal value of the indexmaxValue
- the maximum legal value of the indexclassName
- the class namemethodName
- the method name
java.lang.IndexOutOfBoundsException
public static void invalidArg(java.lang.String argName, java.lang.String argValue, java.lang.String className, java.lang.String methodName)
argName
- the name of the invalid argumentargValue
- the value of the invalid argumentclassName
- the class namemethodName
- the method name
java.lang.IllegalArgumentException
public static void invalidArg(java.lang.String argName, int argValue, java.lang.String className, java.lang.String methodName)
argName
- the name of the invalid argumentargValue
- the value of the invalid argumentclassName
- the class namemethodName
- the method name
java.lang.IllegalArgumentException
public static void unsupported()
java.lang.UnsupportedOperationException
public static EventLocation getEventLocation(java.lang.String className, java.lang.String methodName)
Returns a code locator to use when reporting errors.
This is a convenience method here only the entity and subentity are initialized.
className
- the class name, used to initialize the entity idmethodName
- the method name, used to initialize the subentity id
EventLocation
public static java.lang.String releaseVersion()
public static java.lang.String buildVersion()
public static java.lang.String buildNumber()
public static java.lang.String buildTime()
|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |