- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BasicMarker
One of the primary purpose of a logging framework is to provide the means to generate debugging
and diagnostic information only when it is needed, and to allow filtering of that information so
that it does not overwhelm the system or the individuals who need to make use of it.
- Author:
- Leonard Woo
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a reference to another Marker.booleanDoes this marker contain the marker named 'name'? If 'name' is null the returned value is always false.booleanDoes this marker contain a reference to the 'other' marker? Marker A is defined to contain marker B, if A == B or if B is referenced by A, or if B is referenced by any one of A's references (recursively).booleanMarkers are considered equal if they have the same name.getName()Get the name of this Marker.inthashCode()Compute the hash code based on the name of this marker.booleanDoes this marker have any references?iterator()Returns an Iterator which can be used to iterate over the references of this marker.booleanRemove a marker reference.
-
Field Details
-
ANY_MARKER
This constant represents any marker, including a null marker.- See Also:
-
ANY_NON_NULL_MARKER
This constant represents any non-null marker.- See Also:
-
-
Method Details
-
getName
String getName()Get the name of this Marker.- Returns:
- name of marker
-
add
Add a reference to another Marker.Note that the fluent API allows adding multiple markers to a logging statement. It is often preferable to use multiple markers instead of nested markers.
- Parameters:
reference- a reference to another marker- Throws:
IllegalArgumentException- if 'reference' is null
-
remove
Remove a marker reference.- Parameters:
reference- the marker reference to remove- Returns:
- true if reference could be found and removed, false otherwise.
-
hasReferences
boolean hasReferences()Does this marker have any references?- Returns:
- true if this marker has one or more references, false otherwise.
-
iterator
Returns an Iterator which can be used to iterate over the references of this marker. An empty iterator is returned when this marker has no references.- Returns:
- Iterator over the references of this marker
-
contains
Does this marker contain a reference to the 'other' marker? Marker A is defined to contain marker B, if A == B or if B is referenced by A, or if B is referenced by any one of A's references (recursively).- Parameters:
other- The marker to test for inclusion.- Returns:
- Whether this marker contains the other marker.
- Throws:
IllegalArgumentException- if 'other' is null
-
contains
Does this marker contain the marker named 'name'? If 'name' is null the returned value is always false.- Parameters:
name- The marker name to test for inclusion.- Returns:
- Whether this marker contains the other marker.
-
equals
Markers are considered equal if they have the same name. -
hashCode
int hashCode()Compute the hash code based on the name of this marker. Note that markers are considered equal if they have the same name.
-