public class UnimplementedFeature
extends java.lang.Object
Usage Guidelines
missing(java.lang.String)
should be used for methods/features which have no substantial
implementation provided.
partial(java.lang.String)
should be used for methods/features which have some implementation
but it is not complete. If possible, place the call to partial
inside
code that only executes when the missing portions of the implementation would be
executed.
todo(java.lang.String)
should be used for anything that needs further review, investigation
or modification. If possible, place the call to todo
inside code
that only executes when the associated condition presents itself.
unsupported(java.lang.String)
should be used for anything feature that exists as a placeholder
but which is not ever planned to be supported.
Example of using tokens:
private static Object token = null; public void someMethod() { if (someCondition) { // the first time this is called, the token is null and the log entry will be made // but subsequent calls will pass the token returned from the first call and the // logging will be suppressed token = UnimplementedFeature.todo("This is a description of the TODO.", token); } }
Modifier and Type | Field and Description |
---|---|
private static java.util.logging.Logger |
logger
Logger
|
private static java.util.Set<java.lang.Object> |
tokens
Set of all tokens provided to callers.
|
Constructor and Description |
---|
UnimplementedFeature() |
Modifier and Type | Method and Description |
---|---|
static void |
experimental(java.lang.String msg)
Log the given message along with the a stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support is at an experimental level.
|
static java.lang.Object |
experimental(java.lang.String msg,
java.lang.Object token)
Conditionally log the given message if the caller's provided token is
null
or if it was not a valid token. |
private static void |
log(java.util.logging.Level level,
java.lang.String code,
java.lang.String msg)
Logging helper method that logs a message at the given level.
|
static void |
missing(java.lang.String msg)
Log the given message along with a given stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support is completely missing.
|
static java.lang.Object |
missing(java.lang.String msg,
java.lang.Object token)
Conditionally log the given message if the caller's provided token is
null
or if it was not a valid token. |
static void |
partial(java.lang.String msg)
Log the given message along with the a stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support is only partially implemented.
|
static java.lang.Object |
partial(java.lang.String msg,
java.lang.Object token)
Conditionally log the given message if the caller's provided token is
null
or if it was not a valid token. |
static void |
todo(java.lang.String msg)
Log the given message along with the a stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support has a TODO remaining.
|
static java.lang.Object |
todo(java.lang.String msg,
java.lang.Object token)
Conditionally log the given message if the caller's provided token is
null
or if it was not a valid token. |
static void |
unsupported(java.lang.String msg)
Log the given message along with a given stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support is never expected to be
provided.
|
static java.lang.Object |
unsupported(java.lang.String msg,
java.lang.Object token)
Conditionally log the given message if the caller's provided token is
null
or if it was not a valid token. |
private static final java.util.logging.Logger logger
private static java.util.Set<java.lang.Object> tokens
public static void missing(java.lang.String msg)
SEVERE
.
Since a call stack will be created and logged, the location of the missing feature will already be readily apparent.
msg
- A description of the missing feature.public static java.lang.Object missing(java.lang.String msg, java.lang.Object token)
null
or if it was not a valid token. Subsequent calls to this method will silently return
without logging if the given token already exists in the set of valid tokens. Any log entry
will have the given text along with the a stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support is completely missing. The
logging is unconditionally done (there is no logging level checked) with the level set
to SEVERE
.
Since a call stack will be created and logged, the location of the missing feature will already be readily apparent.
msg
- A description of the missing feature.token
- A previously provided token value that uniquely distinguishes the caller
or null
if this is the first call.public static void partial(java.lang.String msg)
SEVERE
.
Since a call stack will be created and logged, the location of the partial feature will already be readily apparent.
msg
- A description of the missing feature.public static java.lang.Object partial(java.lang.String msg, java.lang.Object token)
null
or if it was not a valid token. Subsequent calls to this method will silently return
without logging if the given token already exists in the set of valid tokens. Any log entry
will have the given text along with the a stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support is only partially implemented.
The logging is unconditionally done (there is no logging level checked) with the level
set to SEVERE
.
Since a call stack will be created and logged, the location of the partial feature will already be readily apparent.
msg
- A description of the missing feature.token
- A previously provided token value that uniquely distinguishes the caller
or null
if this is the first call.public static void experimental(java.lang.String msg)
SEVERE
.
Since a call stack will be created and logged, the location of the experimental feature will already be readily apparent.
msg
- A description of the experimental feature.public static java.lang.Object experimental(java.lang.String msg, java.lang.Object token)
null
or if it was not a valid token. Subsequent calls to this method will silently return
without logging if the given token already exists in the set of valid tokens. Any log entry
will have the given text along with the a stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support is at an experimental level.
The logging is unconditionally done (there is no logging level checked) with the level
set to SEVERE
.
Since a call stack will be created and logged, the location of the experimental feature will already be readily apparent.
msg
- A description of the experimental feature.token
- A previously provided token value that uniquely distinguishes the caller
or null
if this is the first call.public static void todo(java.lang.String msg)
SEVERE
.
Since a call stack will be created and logged, the location of the TODO will already be readily apparent.
msg
- A description of the missing feature.public static java.lang.Object todo(java.lang.String msg, java.lang.Object token)
null
or if it was not a valid token. Subsequent calls to this method will silently return
without logging if the given token already exists in the set of valid tokens. Any log entry
will have the given text along with the a stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support has a TODO remaining. The
logging is unconditionally done (there is no logging level checked) with the level set
to SEVERE
.
Since a call stack will be created and logged, the location of the TODO will already be readily apparent.
msg
- A description of the missing feature.token
- A previously provided token value that uniquely distinguishes the caller
or null
if this is the first call.public static void unsupported(java.lang.String msg)
SEVERE
.
Since a call stack will be created and logged, the location of the unsupported feature will already be readily apparent.
msg
- A description of the unsupported feature.public static java.lang.Object unsupported(java.lang.String msg, java.lang.Object token)
null
or if it was not a valid token. Subsequent calls to this method will silently return
without logging if the given token already exists in the set of valid tokens. Any log entry
will have the given text along with the a stack trace and a prefix that indicates that
a feature was used at runtime for which the runtime support is never expected to be
provided. The logging is unconditionally done (there is no logging level checked) with the
level set to SEVERE
.
Since a call stack will be created and logged, the location of the unsupported feature will already be readily apparent.
msg
- A description of the unsupported feature.token
- A previously provided token value that uniquely distinguishes the caller
or null
if this is the first call.private static void log(java.util.logging.Level level, java.lang.String code, java.lang.String msg)
level
- Logging level.code
- Describes the type of unimplemented feature.msg
- The caller-defined message.