Class SPDXMatcherFactory
java.lang.Object
org.apache.rat.analysis.matchers.SPDXMatcherFactory
Defines a factory to produce matchers for an SPDX tag. SPDX tag is of the
format
SPDX-License-Identifier: short-name where short-name
matches the regex pattern [A-Za-z0-9\.\-]+
SPDX identifiers are specified by the Software Package Data Exchange(R) also known as SPDX(R) project from the Linux foundation.
Each factory instance maintains its own matcher map and per-document match
state (lastMatch, checked). In multi-threaded environments
(e.g. parallel Maven builds), use newInstance() or a
ThreadLocal<SPDXMatcherFactory> to obtain a per-thread factory
instead of the shared INSTANCE.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionCreates the SPDX matcher.static SPDXMatcherFactoryCreates a new SPDXMatcherFactory instance.
-
Field Details
-
INSTANCE
Deprecated.Not thread-safe. UsenewInstance()to create per-thread instances instead. Will be removed in 1.0.0.The shared instance of this factory.
-
-
Method Details
-
newInstance
Creates a new SPDXMatcherFactory instance.Use this method to obtain a per-thread factory for multi-threaded environments instead of the shared
INSTANCE.- Returns:
- a new SPDXMatcherFactory instance.
-
create
Creates the SPDX matcher.- Parameters:
spdxId- the SPDX name to match.- Returns:
- a SPDX matcher.
-