public final class ExtensionPointName<T> extends BaseExtensionPointName<T>
ProjectExtensionPointName
.Constructor and Description |
---|
ExtensionPointName(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addExtensionPointListener(ExtensionPointChangeListener listener,
Disposable parentDisposable) |
void |
addExtensionPointListener(ExtensionPointListener<T> listener,
Disposable parentDisposable) |
<R> R |
computeSafeIfAny(java.util.function.Function<T,R> processor) |
static <T> ExtensionPointName<T> |
create(java.lang.String name) |
java.util.stream.Stream<T> |
extensions() |
java.util.stream.Stream<T> |
extensions(AreaInstance areaInstance)
Consider using
ProjectExtensionPointName.extensions(AreaInstance) |
<V extends T> |
findExtension(java.lang.Class<V> instanceOf) |
<V extends T> |
findExtensionOrFail(java.lang.Class<V> exactClass) |
<V extends T> |
findExtensionOrFail(java.lang.Class<V> instanceOf,
AreaInstance areaInstance) |
<V extends T> |
findFirstAssignableExtension(java.lang.Class<V> instanceOf) |
T |
findFirstSafe(java.util.function.Predicate<? super T> predicate) |
void |
forEachExtensionSafe(java.util.function.Consumer<? super T> consumer)
Invokes the given consumer for each extension registered in this extension point.
|
java.util.List<T> |
getExtensionList() |
java.util.List<T> |
getExtensionList(AreaInstance areaInstance)
Consider using
ProjectExtensionPointName.getExtensions(AreaInstance) |
T [] |
getExtensions()
Prefer to use
getExtensionList() . |
T [] |
getExtensions(AreaInstance areaInstance)
Consider using
ProjectExtensionPointName.getExtensions(AreaInstance) |
java.util.List<T> |
getExtensionsIfPointIsRegistered() |
java.util.List<T> |
getExtensionsIfPointIsRegistered(AreaInstance areaInstance) |
java.lang.Iterable<T> |
getIterable()
Do not use it if there is any extension point listener, because in this case behaviour is not predictable -
events will be fired during iteration and probably it will be not expected.
|
ExtensionPoint<T> |
getPoint(AreaInstance areaInstance) |
boolean |
hasAnyExtensions() |
void |
processWithPluginDescriptor(java.util.function.BiConsumer<? super T,? super PluginDescriptor> consumer) |
getName, getPointImpl, toString
public static <T> ExtensionPointName<T> create(java.lang.String name)
public T [] getExtensions()
getExtensionList()
.public java.util.List<T> getExtensionList()
public void forEachExtensionSafe(java.util.function.Consumer<? super T> consumer)
public <R> R computeSafeIfAny(java.util.function.Function<T,R> processor)
public java.util.List<T> getExtensionsIfPointIsRegistered()
public java.util.List<T> getExtensionsIfPointIsRegistered(AreaInstance areaInstance)
public java.util.stream.Stream<T> extensions()
public boolean hasAnyExtensions()
public java.util.List<T> getExtensionList(AreaInstance areaInstance)
ProjectExtensionPointName.getExtensions(AreaInstance)
public T [] getExtensions(AreaInstance areaInstance)
ProjectExtensionPointName.getExtensions(AreaInstance)
public java.util.stream.Stream<T> extensions(AreaInstance areaInstance)
ProjectExtensionPointName.extensions(AreaInstance)
public ExtensionPoint<T> getPoint(AreaInstance areaInstance)
public <V extends T> V findExtension(java.lang.Class<V> instanceOf)
public <V extends T> V findExtensionOrFail(java.lang.Class<V> exactClass)
public <V extends T> V findFirstAssignableExtension(java.lang.Class<V> instanceOf)
public <V extends T> V findExtensionOrFail(java.lang.Class<V> instanceOf, AreaInstance areaInstance)
public final java.lang.Iterable<T> getIterable()
Use only for interface extension points, not for bean.
Due to internal reasons, there is no easy way to implement hasNext in a reliable manner, so, `next` may return `null` (in this case stop iteration).
Possible use cases: 1. Conditional iteration (no need to create all extensions if iteration will be stopped due to some condition). 2. Iterated only once per application (no need to cache extension list internally).
public void processWithPluginDescriptor(java.util.function.BiConsumer<? super T,? super PluginDescriptor> consumer)
public void addExtensionPointListener(ExtensionPointListener<T> listener, Disposable parentDisposable)
public void addExtensionPointListener(ExtensionPointChangeListener listener, Disposable parentDisposable)