public class AddNameFromAddressResourceTransformer extends Object implements ResourceTransformer
ResourceTransformer
that takes the value in the last element of the given address
and stores it in a model attribute named name
.
This transformer can be used to preserve compatibility when ReadResourceNameOperationStepHandler
is
used to replace storage of a resource name in the model.
ReadResourceNameOperationStepHandler
Modifier and Type | Field and Description |
---|---|
static AddNameFromAddressResourceTransformer |
INSTANCE |
DEFAULT, DISCARD
Modifier and Type | Method and Description |
---|---|
void |
transformResource(ResourceTransformationContext context,
PathAddress address,
Resource resource)
Transform a resource.
|
public static final AddNameFromAddressResourceTransformer INSTANCE
public void transformResource(ResourceTransformationContext context, PathAddress address, Resource resource) throws OperationFailedException
ResourceTransformer
transformResource
in interface ResourceTransformer
context
- the resource transformation contextaddress
- the path addressresource
- the resource to transformOperationFailedException
Copyright © 2023 JBoss by Red Hat. All rights reserved.