@Override
    public void modifyMember(
            AbstractShapeBuilder<?, ?> shapeBuilder,
            MemberShape.Builder memberBuilder,
            Function<ShapeId, Map<ShapeId, Trait>> unclaimedTraits,
            Function<ShapeId, Shape> shapeMap
    ) {
        // Fast-fail the common case of the target having already been set.
        if (memberBuilder.getTarget() != null) {
            return;
        }

        Shape fromShape = shapeMap.apply(resourceId);
        if (fromShape == null) {
            throw new SourceException("Cannot apply resource to elided member " + memberBuilder.getId() + ": "
                    + resourceId + " not found", memberBuilder);
        }

        if (!fromShape.isResourceShape()) {
            fromShapeIsNotResource(memberBuilder, fromShape);
        } else {
            ResourceShape resource = fromShape.asResourceShape().get();
            String name = memberBuilder.getId().getMember().get();
            if (resource.getIdentifiers().containsKey(name)) {
                memberBuilder.target(resource.getIdentifiers().get(name));
            }
            if (resource.getProperties().containsKey(name)) {
                memberBuilder.target(resource.getProperties().get(name));
            }
        }
    }
Sets member targets based on referenced resource identifiers.

<p>Structures can elide the targets of members if they're bound to a resource
and that resource has an identifier with a matching name. Here we set the
target based on that information.
smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyResourceBasedTargets.java