@FunctionalInterface
public interface TraitFactory
Modifier and Type | Method and Description |
---|---|
static TraitFactory |
createServiceFactory()
Creates a TraitFactory that discovers TraitService providers using
the Thread context class loader.
|
static TraitFactory |
createServiceFactory(java.lang.ClassLoader classLoader)
Creates a TraitFactory that discovers TraitService providers using
the given ClassLoader.
|
static TraitFactory |
createServiceFactory(java.lang.Iterable<TraitService> services)
Creates a TraitFactory that uses a List of TraitService provider instances.
|
java.util.Optional<Trait> |
createTrait(ShapeId id,
ShapeId target,
Node value)
Creates and configures a trait using model trait data.
|
java.util.Optional<Trait> createTrait(ShapeId id, ShapeId target, Node value)
id
- Shape ID of the trait.target
- Shape that the trait is applied on.value
- The Node value of the trait.SourceException
- on configuration error.java.lang.RuntimeException
- if an error occurs while creating the trait.static TraitFactory createServiceFactory(java.lang.Iterable<TraitService> services)
services
- List of TraitService provider instances.static TraitFactory createServiceFactory()
static TraitFactory createServiceFactory(java.lang.ClassLoader classLoader)
classLoader
- Class loader used to find TraitService providers.