Class RebindServiceImpl
java.lang.Object
ch.tocco.nice2.netui.impl.bind.entity.RebindServiceImpl
- All Implemented Interfaces:
RebindService
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.netui.api.bind.entity.RebindService
RebindService.Scope
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRebindServiceImpl
(UriResolver uriResolver, Context context, EntityDefaultValueService entityDefaultValueService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
rebind
(RebindValue[] values) Overloaded method where scope=null, fillNonNullable=true, fillEntityDefaults=true.void
rebind
(RebindValue[] values, @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults) Rebinds the given values by finding/creating the affected entities and putting the values on them.rebindAndGetAffectedEntities
(RebindValue[] values, RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults) Returns all affected entities.rebindAndGetEntity
(RebindValue[] values, @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults, Predicate<Entity> selectRequiredEntityPredicate) Selects the returned entity with a predicate.rebindAndGetEntity
(RebindValue[] values, @Nullable RebindService.Scope scope, String expectedEntityType) Overloaded method where fillNonNullable=true, fillEntityDefaults=true.rebindAndGetEntity
(RebindValue[] values, @Nullable RebindService.Scope scope, String expectedEntityType, boolean fillNonNullable, boolean fillEntityDefaults) Same asRebindService.rebind(ch.tocco.nice2.netui.api.bind.entity.RebindValue[], ch.tocco.nice2.netui.api.bind.entity.RebindService.Scope, boolean, boolean)
but also returns the "primary" Entity.rebindAndGetEntity
(RebindValue[] values, String expectedEntityType) Same asRebindService.rebind(ch.tocco.nice2.netui.api.bind.entity.RebindValue[], ch.tocco.nice2.netui.api.bind.entity.RebindService.Scope, boolean, boolean)
but also returns the "primary" Entity.rebindAndGetEntity
(RebindValue[] values, String expectedEntityType, boolean fillNonNullable, boolean fillEntityDefaults) Same asRebindService.rebind(ch.tocco.nice2.netui.api.bind.entity.RebindValue[], ch.tocco.nice2.netui.api.bind.entity.RebindService.Scope, boolean, boolean)
but also returns the "primary" Entity.rebindAndGetEntityOneOfExpectedTypes
(RebindValue[] values, @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults, String... expectedEntityTypes) Same asRebindService.rebindAndGetEntity(ch.tocco.nice2.netui.api.bind.entity.RebindValue[], java.lang.String)
but returns the first Entity found in one of the expected types.rebindAndGetEntityOneOfExpectedTypes
(RebindValue[] values, @Nullable RebindService.Scope scope, String... expectedEntityTypes) Overloaded method where fillNonNullable=true, fillEntityDefaults=true.rebindAndGetEntityOneOfExpectedTypes
(RebindValue[] values, String... expectedEntityTypes) Overloaded method where fillNonNullable=true, fillEntityDefaults=true.
-
Field Details
-
HISTORY
- See Also:
-
-
Constructor Details
-
RebindServiceImpl
public RebindServiceImpl(UriResolver uriResolver, Context context, EntityDefaultValueService entityDefaultValueService)
-
-
Method Details
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, String expectedEntityType) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindService
Same asRebindService.rebind(ch.tocco.nice2.netui.api.bind.entity.RebindValue[], ch.tocco.nice2.netui.api.bind.entity.RebindService.Scope, boolean, boolean)
but also returns the "primary" Entity.- Specified by:
rebindAndGetEntity
in interfaceRebindService
- Returns:
- The first Entity of type expectedEntityType. If there could be more then one then you may wish to either use your own listeners to get what you need, or refactor/add functionality.
- Throws:
RebindException
- For example if there is no Entity touched of theexpectedEntityType
.UnresolvableUriException
UriStoreException
URISyntaxException
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, String expectedEntityType) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindService
Overloaded method where fillNonNullable=true, fillEntityDefaults=true.- Specified by:
rebindAndGetEntity
in interfaceRebindService
- Throws:
UnresolvableUriException
UriStoreException
URISyntaxException
RebindException
- See Also:
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, String expectedEntityType, boolean fillNonNullable, boolean fillEntityDefaults) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindService
Same asRebindService.rebind(ch.tocco.nice2.netui.api.bind.entity.RebindValue[], ch.tocco.nice2.netui.api.bind.entity.RebindService.Scope, boolean, boolean)
but also returns the "primary" Entity.- Specified by:
rebindAndGetEntity
in interfaceRebindService
- Returns:
- The first Entity of type expectedEntityType. If there could be more then one then you may wish to either use your own listeners to get what you need, or refactor/add functionality.
- Throws:
RebindException
- For example if there is no Entity touched of theexpectedEntityType
.UnresolvableUriException
UriStoreException
URISyntaxException
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, String expectedEntityType, boolean fillNonNullable, boolean fillEntityDefaults) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindService
Same asRebindService.rebind(ch.tocco.nice2.netui.api.bind.entity.RebindValue[], ch.tocco.nice2.netui.api.bind.entity.RebindService.Scope, boolean, boolean)
but also returns the "primary" Entity.- Specified by:
rebindAndGetEntity
in interfaceRebindService
- Returns:
- The first Entity of type expectedEntityType. If there could be more then one then you may wish to either use your own listeners to get what you need, or refactor/add functionality.
- Throws:
RebindException
- For example if there is no Entity touched of theexpectedEntityType
.UnresolvableUriException
UriStoreException
URISyntaxException
-
rebindAndGetEntityOneOfExpectedTypes
public Entity rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, String... expectedEntityTypes) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindService
Overloaded method where fillNonNullable=true, fillEntityDefaults=true.- Specified by:
rebindAndGetEntityOneOfExpectedTypes
in interfaceRebindService
- Throws:
UnresolvableUriException
UriStoreException
URISyntaxException
RebindException
- See Also:
-
rebindAndGetEntityOneOfExpectedTypes
public Entity rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, String... expectedEntityTypes) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindService
Overloaded method where fillNonNullable=true, fillEntityDefaults=true.- Specified by:
rebindAndGetEntityOneOfExpectedTypes
in interfaceRebindService
- Throws:
UnresolvableUriException
UriStoreException
URISyntaxException
RebindException
- See Also:
-
rebindAndGetEntityOneOfExpectedTypes
public Entity rebindAndGetEntityOneOfExpectedTypes(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults, String... expectedEntityTypes) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindService
Same asRebindService.rebindAndGetEntity(ch.tocco.nice2.netui.api.bind.entity.RebindValue[], java.lang.String)
but returns the first Entity found in one of the expected types. You have to manually check of which type the returned entity is.
Hint: This method is made for public forms where it is not clear what entity type will be affected resp. changed. Example: The user can change values of user entity and/or address entity and/or membership entity on the same form.- Specified by:
rebindAndGetEntityOneOfExpectedTypes
in interfaceRebindService
- Returns:
- The first Entity of one of the type expectedEntityTypes.
- Throws:
RebindException
- For example if there is no Entity touched one of theexpectedEntityTypes
.UnresolvableUriException
UriStoreException
URISyntaxException
-
rebindAndGetEntity
public Entity rebindAndGetEntity(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults, Predicate<Entity> selectRequiredEntityPredicate) throws UnresolvableUriException, UriStoreException, URISyntaxException, RebindException Description copied from interface:RebindService
Selects the returned entity with a predicate. Predicate must be true for exactly one entity in any case.- Specified by:
rebindAndGetEntity
in interfaceRebindService
- Throws:
UnresolvableUriException
UriStoreException
URISyntaxException
RebindException
-
rebindAndGetAffectedEntities
public Set<Entity> rebindAndGetAffectedEntities(RebindValue[] values, RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults) throws UnresolvableUriException, UriStoreException, URISyntaxException, ObjectOutdatedException Description copied from interface:RebindService
Returns all affected entities.- Specified by:
rebindAndGetAffectedEntities
in interfaceRebindService
- Throws:
UnresolvableUriException
UriStoreException
URISyntaxException
ObjectOutdatedException
-
rebind
public void rebind(RebindValue[] values) throws UnresolvableUriException, UriStoreException, URISyntaxException, ObjectOutdatedException Description copied from interface:RebindService
Overloaded method where scope=null, fillNonNullable=true, fillEntityDefaults=true.- Specified by:
rebind
in interfaceRebindService
- Throws:
UnresolvableUriException
UriStoreException
URISyntaxException
ObjectOutdatedException
- See Also:
-
rebind
public void rebind(RebindValue[] values, @Nullable @Nullable RebindService.Scope scope, boolean fillNonNullable, boolean fillEntityDefaults) throws UnresolvableUriException, UriStoreException, URISyntaxException, ObjectOutdatedException Description copied from interface:RebindService
Rebinds the given values by finding/creating the affected entities and putting the values on them.You can still set up your own listeners (entity-creating etc).
- Specified by:
rebind
in interfaceRebindService
- Parameters:
scope
- Do not passnull
for scope 'copy', it is essential to know that scope.fillNonNullable
- Handles this case automatically for you.fillEntityDefaults
- Handles this case automatically for you.- Throws:
UnresolvableUriException
UriStoreException
URISyntaxException
ObjectOutdatedException
-