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

adding method to allow choosing when to instantiate null params #660

Merged
merged 8 commits into from
Jul 4, 2014

Conversation

Turini
Copy link
Member

@Turini Turini commented Jul 3, 2014

Fixes #532

@Turini Turini self-assigned this Jul 3, 2014
@Turini
Copy link
Member Author

Turini commented Jul 3, 2014

what do you think guys? (note: docs coming soon)

Instantiator<Object> objectInstantiator = new ObjectInstantiator(this, provider, parameterNameProvider);

if (!instantiateNullParameters()) {
objectInstantiator = new NullDecorator(objectInstantiator);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too smart :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NullDecorator keeps nulls? If so, you shouldn't have the ! on the if.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind. But the name is confusing.

I'd use something like useNullForMissingParameters with false as default. And change the method to protected

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with useNullForMissingParameters. Good point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you guys, done here 99ae0c0

@Turini
Copy link
Member Author

Turini commented Jul 4, 2014

all changes applied, I'll write some docs about it before 🚢

@Turini
Copy link
Member Author

Turini commented Jul 4, 2014

docs added here #663. Can I 🐑 it?

multiInstantiator = new MultiInstantiator(instantiatorList);
}

public boolean useNullForMissingParameters() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not protected, use only extended

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protected++

@garcia-jj
Copy link
Member

:go-horse:

Turini added a commit that referenced this pull request Jul 4, 2014
adding method to allow choosing when to instantiate null params
@Turini Turini merged commit 01c22e0 into master Jul 4, 2014
@Turini Turini deleted the nullOrNotNullThisIsTheQuestion branch July 4, 2014 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vraptor instantiate even has no request parameters for object
4 participants