Top Description Fields Constructors Methods
org.jboss.logmanager.filters

public final Class SubstituteFilter

extends Object
implements Filter
Class Inheritance
All Implemented Interfaces
java.util.logging.Filter
Imports
java.text.MessageFormat, java.util.logging.Filter, .LogRecord, java.util.regex.Matcher, .Pattern, org.jboss.logmanager.ExtLogRecord, .ExtLogRecord.FormatStyle

A filter which applies a text substitution on the message if the nested filter matches.

Field Summary

Modifier and TypeField and Description
private final Pattern
private final boolean
private final String

Constructor Summary

AccessConstructor and Description
public
SubstituteFilter(final Pattern
the pattern to match
pattern
,
final String
the string replacement
replacement
,
final boolean
true if all occurrences should be replaced; false if only the first occurrence
replaceAll
)

Construct a new instance.

public
SubstituteFilter(final String
the pattern to match
patternString
,
final String
the string replacement
replacement
,
final boolean
true if all occurrences should be replaced; false if only the first occurrence
replaceAll
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true always
isLoggable
(final LogRecord
the log record to inspect and modify
record
)

Implements java.util.logging.Filter.isLoggable.

Apply the filter to the given log record.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

patternback to summary
private final Pattern pattern
replaceAllback to summary
private final boolean replaceAll
replacementback to summary
private final String replacement

Constructor Detail

SubstituteFilterback to summary
public SubstituteFilter(final Pattern pattern, final String replacement, final boolean replaceAll)

Construct a new instance.

Parameters
pattern:Pattern

the pattern to match

replacement:String

the string replacement

replaceAll:boolean

true if all occurrences should be replaced; false if only the first occurrence

SubstituteFilterback to summary
public SubstituteFilter(final String patternString, final String replacement, final boolean replaceAll)

Construct a new instance.

Parameters
patternString:String

the pattern to match

replacement:String

the string replacement

replaceAll:boolean

true if all occurrences should be replaced; false if only the first occurrence

Method Detail

isLoggableback to summary
public boolean isLoggable(final LogRecord record)

Implements java.util.logging.Filter.isLoggable.

Apply the filter to the given log record.

The format style will always be set to FormatStyle#NO_FORMAT as the formatted message will be the one used in the replacement.

Parameters
record:LogRecord

the log record to inspect and modify

Returns:boolean

true always

Annotations
@Override