Class RegistrationConfigurerImpl<S,T>
- java.lang.Object
-
- org.palladiosimulator.textual.tpcm.generator.RegistrationConfigurerImpl<S,T>
-
- All Implemented Interfaces:
RegistrationConfigurer<S,T>
public class RegistrationConfigurerImpl<S,T> extends Object implements RegistrationConfigurer<S,T>
-
-
Constructor Summary
Constructors Constructor Description RegistrationConfigurerImpl(Registration<S,T> reg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <PS,PT>
ValueApplierConfigurer<PT,T>map(Function<S,PS> contentProvider)
Defines a transformation for a child element.<PS,PT>
ValueApplierConfigurer<PT,T>map(Function<S,PS> contentProvider, Class<PT> target)
Defines a transformation for a child element.<PS,PT>
ValueApplierConfigurer<List<PT>,T>mapAll(Function<S,? extends List<PS>> contentProvider)
Defines a transformation for child elements.<PS,PT>
ValueApplierConfigurer<List<PT>,T>mapAll(Function<S,? extends List<PS>> contentProvider, Class<PT> target)
Defines a transformation for child elements.void
setAfter(Consumer<T> callback)
(Optional) Defines what to do after all child element transformations have finished.void
setCreate(Function<S,T> factory)
(Required) Defines how the target object can be created from the given source.void
setWhen(Predicate<S> guard)
(Optional) Defines a predicate for this transformation.
-
-
-
Constructor Detail
-
RegistrationConfigurerImpl
public RegistrationConfigurerImpl(Registration<S,T> reg)
-
-
Method Detail
-
map
public <PS,PT> ValueApplierConfigurer<PT,T> map(Function<S,PS> contentProvider)
Description copied from interface:RegistrationConfigurer
Defines a transformation for a child element.- Specified by:
map
in interfaceRegistrationConfigurer<S,T>
- Parameters:
contentProvider
- Provider for how get this element from the source element- See Also:
ValueApplierConfigurer
-
mapAll
public <PS,PT> ValueApplierConfigurer<List<PT>,T> mapAll(Function<S,? extends List<PS>> contentProvider)
Description copied from interface:RegistrationConfigurer
Defines a transformation for child elements.- Specified by:
mapAll
in interfaceRegistrationConfigurer<S,T>
- Parameters:
contentProvider
- Provider for how get these elements from the source element- See Also:
ValueApplierConfigurer
-
setCreate
public void setCreate(Function<S,T> factory)
Description copied from interface:RegistrationConfigurer
(Required) Defines how the target object can be created from the given source.- Specified by:
setCreate
in interfaceRegistrationConfigurer<S,T>
-
setWhen
public void setWhen(Predicate<S> guard)
Description copied from interface:RegistrationConfigurer
(Optional) Defines a predicate for this transformation. This makes sure that the transformation only happens, if the predicate defined here tests successfully.- Specified by:
setWhen
in interfaceRegistrationConfigurer<S,T>
-
map
public <PS,PT> ValueApplierConfigurer<PT,T> map(Function<S,PS> contentProvider, Class<PT> target)
Description copied from interface:RegistrationConfigurer
Defines a transformation for a child element.- Specified by:
map
in interfaceRegistrationConfigurer<S,T>
- Parameters:
contentProvider
- Provider for how get this element from the source elementtarget
- The desired target type for these elements- See Also:
ValueApplierConfigurer
-
mapAll
public <PS,PT> ValueApplierConfigurer<List<PT>,T> mapAll(Function<S,? extends List<PS>> contentProvider, Class<PT> target)
Description copied from interface:RegistrationConfigurer
Defines a transformation for child elements.- Specified by:
mapAll
in interfaceRegistrationConfigurer<S,T>
- Parameters:
contentProvider
- Provider for how get these elements from the source elementtarget
- The desired target type for these elements- See Also:
ValueApplierConfigurer
-
setAfter
public void setAfter(Consumer<T> callback)
Description copied from interface:RegistrationConfigurer
(Optional) Defines what to do after all child element transformations have finished.- Specified by:
setAfter
in interfaceRegistrationConfigurer<S,T>
-
-