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 voidaddChannelConversion(ChannelConversion channelConversion)voidaddMapping(Mapping mapping)voidaddProperty(java.lang.String key, java.lang.Object value)voidaddRequiredPlatform(Platform platform)voidexcludeChannelConversion(ChannelConversion channelConversion)voidexcludeMapping(Mapping mapping)voidexcludeRequiredPlatform(Platform platform)java.util.Collection<ChannelConversion>getChannelConversions()Provides theChannelConversions shipped with this instance.java.util.Collection<ChannelConversion>getExcludedChannelConversions()Provides theChannelConversions excluded by this instance.java.util.Collection<Mapping>getExcludedMappings()Provides theMappings excluded by this instance.java.util.Collection<Platform>getExcludedRequiredPlatforms()Provides the requiredPlatforms excluded by this instance.java.util.Collection<Mapping>getMappings()Provides theMappings shipped with this instance.java.util.Collection<Platform>getRequiredPlatforms()Provides thePlatforms required by this instance.static <T> voidifPresent(java.lang.Object o, java.lang.Class<? super T> t, java.util.function.Consumer<T> consumer)Checks and casts the givenObject.static DynamicPluginloadYaml(java.lang.String yamlUrl)Loads a YAML file of the following format:voidsetProperties(Configuration configuration)Provides relevantConfigurationproperties.
-
-
-
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 castedounless 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:PluginProvides thePlatforms required by this instance.- Specified by:
getRequiredPlatformsin interfacePlugin- Returns:
- the
Platforms
-
getExcludedRequiredPlatforms
public java.util.Collection<Platform> getExcludedRequiredPlatforms()
Description copied from interface:PluginProvides the requiredPlatforms excluded by this instance.- Specified by:
getExcludedRequiredPlatformsin interfacePlugin- Returns:
- the
Platforms
-
addMapping
public void addMapping(Mapping mapping)
-
excludeMapping
public void excludeMapping(Mapping mapping)
-
getMappings
public java.util.Collection<Mapping> getMappings()
Description copied from interface:PluginProvides theMappings shipped with this instance.- Specified by:
getMappingsin interfacePlugin- Returns:
- the
Mappings
-
getExcludedMappings
public java.util.Collection<Mapping> getExcludedMappings()
Description copied from interface:PluginProvides theMappings excluded by this instance.- Specified by:
getExcludedMappingsin interfacePlugin- Returns:
- the
Mappings
-
addChannelConversion
public void addChannelConversion(ChannelConversion channelConversion)
-
excludeChannelConversion
public void excludeChannelConversion(ChannelConversion channelConversion)
-
getChannelConversions
public java.util.Collection<ChannelConversion> getChannelConversions()
Description copied from interface:PluginProvides theChannelConversions shipped with this instance.- Specified by:
getChannelConversionsin interfacePlugin- Returns:
- the
ChannelConversions
-
getExcludedChannelConversions
public java.util.Collection<ChannelConversion> getExcludedChannelConversions()
Description copied from interface:PluginProvides theChannelConversions excluded by this instance.- Specified by:
getExcludedChannelConversionsin interfacePlugin- Returns:
- the
ChannelConversions
-
addProperty
public void addProperty(java.lang.String key, java.lang.Object value)
-
setProperties
public void setProperties(Configuration configuration)
Description copied from interface:PluginProvides relevantConfigurationproperties.- Specified by:
setPropertiesin interfacePlugin- Parameters:
configuration- accepts the properties
-
-