public final class BuildContext extends Object
| Constructor and Description |
|---|
BuildContext(ClassLoader classLoader,
StepInfo stepInfo,
Execution execution) |
| Modifier and Type | Method and Description |
|---|---|
<T extends SimpleBuildItem> |
consume(Class<T> type)
Consume the value produced for the named item.
|
<T extends MultiBuildItem> |
consumeMulti(Class<T> type)
Consume all of the values produced for the named item.
|
<T extends MultiBuildItem> |
consumeMulti(Class<T> type,
Comparator<? super T> comparator)
Consume all of the values produced for the named item, re-sorting it according
to the given comparator.
|
(package private) void |
depFinished() |
void |
error(Location location,
String format,
Object... args)
Emit a build error.
|
String |
getBuildTargetName()
Get the name of this build target.
|
Executor |
getExecutor()
Get an executor which can be used for asynchronous tasks.
|
boolean |
isAvailableToConsume(Class<? extends BuildItem> type)
Determine if a item was produced and is therefore available to be consumed.
|
boolean |
isConsumed(Class<? extends BuildItem> type)
Determine if a item will be consumed in this build.
|
void |
note(Location location,
String format,
Object... args)
Emit a build note.
|
void |
produce(BuildItem item)
Produce the given item.
|
<T extends BuildItem> |
produce(Class<T> type,
T item)
Produce the given item.
|
void |
produce(List<? extends MultiBuildItem> items)
Produce the given items.
|
(package private) void |
run() |
void |
warn(Location location,
String format,
Object... args)
Emit a build warning.
|
BuildContext(ClassLoader classLoader, StepInfo stepInfo, Execution execution)
public String getBuildTargetName()
null)public void produce(BuildItem item)
type refers to a item which is declared with multiplicity, then this
method can be called more than once for the given type, otherwise it must be called no more than once.item - the item value (must not be null)IllegalArgumentException - if the item does not allow multiplicity but this method is called more than one time,
or if the type of item could not be determinedpublic void produce(List<? extends MultiBuildItem> items)
typeitems - the items (must not be null)IllegalArgumentException - if the type of item could not be determinedpublic <T extends BuildItem> void produce(Class<T> type, T item)
type refers to a item which is declared with multiplicity, then this
method can be called more than once for the given type, otherwise it must be called no more than once.type - the item type (must not be null)item - the item value (may be null)IllegalArgumentException - if this deployer was not declared to produce type, or if type is
null, or if
the item does not allow multiplicity but this method is called more than one timepublic <T extends SimpleBuildItem> T consume(Class<T> type)
type - the item type (must not be null)null)IllegalArgumentException - if this deployer was not declared to consume type, or if type is
nullClassCastException - if the cast failedpublic <T extends MultiBuildItem> List<T> consumeMulti(Class<T> type)
Comparable, it will be sorted by natural order before return. The returned list
is a mutable copy.type - the item element type (must not be null)null)IllegalArgumentException - if this deployer was not declared to consume type, or if type is
nullpublic <T extends MultiBuildItem> List<T> consumeMulti(Class<T> type, Comparator<? super T> comparator)
type - the item element type (must not be null)comparator - the comparator to use (must not be null)null)IllegalArgumentException - if this deployer was not declared to consume type, or if type is
nullpublic boolean isAvailableToConsume(Class<? extends BuildItem> type)
type - the item type (must not be null)true if the item was produced and is available, false if it was not or if this deployer does
not consume the named itempublic boolean isConsumed(Class<? extends BuildItem> type)
type - the item type (must not be null)true if the item will be consumed, false if it will not be or if this deployer does
not produce the named itempublic void note(Location location, String format, Object... args)
location - the location of interest (may be null)format - the format string (see String.format(String, Object...))args - the format argumentspublic void warn(Location location, String format, Object... args)
location - the location of interest (may be null)format - the format string (see String.format(String, Object...))args - the format argumentspublic void error(Location location, String format, Object... args)
location - the location of interest (may be null)format - the format string (see String.format(String, Object...))args - the format argumentspublic Executor getExecutor()
void depFinished()
void run()
Copyright © 2020 JBoss by Red Hat. All rights reserved.