Package org.apache.wayang.core.plugin
Class DynamicPlugin
- java.lang.Object
-
- org.apache.wayang.core.plugin.DynamicPlugin
-
-
Constructor Summary
Constructors Constructor Description DynamicPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChannelConversion(ChannelConversion channelConversion)
void
addMapping(Mapping mapping)
void
addProperty(java.lang.String key, java.lang.Object value)
void
addRequiredPlatform(Platform platform)
void
excludeChannelConversion(ChannelConversion channelConversion)
void
excludeMapping(Mapping mapping)
void
excludeRequiredPlatform(Platform platform)
java.util.Collection<ChannelConversion>
getChannelConversions()
Provides theChannelConversion
s shipped with this instance.java.util.Collection<ChannelConversion>
getExcludedChannelConversions()
Provides theChannelConversion
s excluded by this instance.java.util.Collection<Mapping>
getExcludedMappings()
Provides theMapping
s excluded by this instance.java.util.Collection<Platform>
getExcludedRequiredPlatforms()
Provides the requiredPlatform
s excluded by this instance.java.util.Collection<Mapping>
getMappings()
Provides theMapping
s shipped with this instance.java.util.Collection<Platform>
getRequiredPlatforms()
Provides thePlatform
s required by this instance.static <T> void
ifPresent(java.lang.Object o, java.lang.Class<? super T> t, java.util.function.Consumer<T> consumer)
Checks and casts the givenObject
.static DynamicPlugin
loadYaml(java.lang.String yamlUrl)
Loads a YAML file of the following format:void
setProperties(Configuration configuration)
Provides relevantConfiguration
properties.
-
-
-
Method Detail
-
loadYaml
public static DynamicPlugin loadYaml(java.lang.String yamlUrl)
Loads a YAML file of the following format:# mappings to be loaded by this plugin mappings: include: - <expression that evaluates to a Mapping instance or Collection of such> - ... exclude: - <expression that evaluates to a Mapping instance or Collection of such> - ... # channel conversions to be loaded by this plugin conversions: include: - <expression that evaulates to a ChannelConversion instance or Collection of such> - .. exclude: - <expression that evaulates to a ChannelConversion instance or Collection of such> - .. # properties configured by this plugin properties: <property name>: <property value> # required platforms platforms: include: - <expression that evaluates to a Platform instance or Collection of such> - .. exclude: - <expression that evaluates to a Platform instance or Collection of such> - ..
- Parameters:
yamlUrl
- an URL to a YAML file of the above format- Returns:
- the configured instance
- See Also:
Supported expressions
-
ifPresent
public static <T> void ifPresent(java.lang.Object o, java.lang.Class<? super T> t, java.util.function.Consumer<T> consumer)
Checks and casts the givenObject
. If it is notnull
, feed it to aConsumer
.- Parameters:
o
- to be castedt
- to that should be castedconsumer
- accepts the castedo
unless it isnull
-
addRequiredPlatform
public void addRequiredPlatform(Platform platform)
-
excludeRequiredPlatform
public void excludeRequiredPlatform(Platform platform)
-
getRequiredPlatforms
public java.util.Collection<Platform> getRequiredPlatforms()
Description copied from interface:Plugin
Provides thePlatform
s required by this instance.- Specified by:
getRequiredPlatforms
in interfacePlugin
- Returns:
- the
Platform
s
-
getExcludedRequiredPlatforms
public java.util.Collection<Platform> getExcludedRequiredPlatforms()
Description copied from interface:Plugin
Provides the requiredPlatform
s excluded by this instance.- Specified by:
getExcludedRequiredPlatforms
in interfacePlugin
- Returns:
- the
Platform
s
-
addMapping
public void addMapping(Mapping mapping)
-
excludeMapping
public void excludeMapping(Mapping mapping)
-
getMappings
public java.util.Collection<Mapping> getMappings()
Description copied from interface:Plugin
Provides theMapping
s shipped with this instance.- Specified by:
getMappings
in interfacePlugin
- Returns:
- the
Mapping
s
-
getExcludedMappings
public java.util.Collection<Mapping> getExcludedMappings()
Description copied from interface:Plugin
Provides theMapping
s excluded by this instance.- Specified by:
getExcludedMappings
in interfacePlugin
- Returns:
- the
Mapping
s
-
addChannelConversion
public void addChannelConversion(ChannelConversion channelConversion)
-
excludeChannelConversion
public void excludeChannelConversion(ChannelConversion channelConversion)
-
getChannelConversions
public java.util.Collection<ChannelConversion> getChannelConversions()
Description copied from interface:Plugin
Provides theChannelConversion
s shipped with this instance.- Specified by:
getChannelConversions
in interfacePlugin
- Returns:
- the
ChannelConversion
s
-
getExcludedChannelConversions
public java.util.Collection<ChannelConversion> getExcludedChannelConversions()
Description copied from interface:Plugin
Provides theChannelConversion
s excluded by this instance.- Specified by:
getExcludedChannelConversions
in interfacePlugin
- Returns:
- the
ChannelConversion
s
-
addProperty
public void addProperty(java.lang.String key, java.lang.Object value)
-
setProperties
public void setProperties(Configuration configuration)
Description copied from interface:Plugin
Provides relevantConfiguration
properties.- Specified by:
setProperties
in interfacePlugin
- Parameters:
configuration
- accepts the properties
-
-