Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for making MapAccessor read-only #33222

Closed
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Jul 17, 2024

Align to ReflectivePropertyAccessor

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 17, 2024
@snicoll
Copy link
Member

snicoll commented Jul 17, 2024

Before we can consider this PR, we'd need to understand the use case. You are talking about alignment but I don't see that as necessary (or inconsistent at the moment). Also, please refrain from doing unrelated changes. All those formatting in the tests should go away.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Jul 17, 2024
Align to `ReflectivePropertyAccessor`
@quaff
Copy link
Contributor Author

quaff commented Jul 17, 2024

Before we can consider this PR, we'd need to understand the use case.

I need EvaluationContext like SimpleEvaluationContext.forReadOnlyDataBinding() plus MapAccessor.

Also, please refrain from doing unrelated changes. All those formatting in the tests should go away.

OK, I will revert those changes.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jul 17, 2024
@snicoll snicoll changed the title Add convenient constructor to create readonly MapAccessor Add support for making MapAccessor read-only Jul 17, 2024
@snicoll snicoll changed the title Add support for making MapAccessor read-only Add support for making MapAccessor read-only Jul 17, 2024
@snicoll snicoll self-assigned this Jul 17, 2024
@snicoll snicoll added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Jul 17, 2024
@snicoll snicoll added this to the 6.2.0-M6 milestone Jul 17, 2024
snicoll pushed a commit that referenced this pull request Jul 17, 2024
snicoll added a commit that referenced this pull request Jul 17, 2024
@snicoll snicoll closed this in 9b34400 Jul 17, 2024
izeye added a commit to izeye/spring-framework that referenced this pull request Oct 6, 2024
@sbrannen
Copy link
Member

sbrannen commented Oct 6, 2024

Hi @quaff,

I need EvaluationContext like SimpleEvaluationContext.forReadOnlyDataBinding() plus MapAccessor.

In order to achieve your goal, you'll actually need to make use of withAssignmentDisabled() as well -- for example, something like the following.

SimpleEvaluationContext context = SimpleEvaluationContext
		.forPropertyAccessors(new MapAccessor(false), DataBindingPropertyAccessor.forReadOnlyAccess())
		.withAssignmentDisabled()
		.build();

@quaff
Copy link
Contributor Author

quaff commented Oct 8, 2024

Thanks for your caution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants