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

Default value support #14

Closed
CptGuo opened this issue May 28, 2019 · 5 comments
Closed

Default value support #14

CptGuo opened this issue May 28, 2019 · 5 comments
Assignees
Milestone

Comments

@CptGuo
Copy link

CptGuo commented May 28, 2019

Hello
Can < value /> element support default-value? if rule return empty string.
example:

<value id="id1" defaultValue="value1">

@daniel-bray-sonalake
Copy link
Collaborator

It's not a feature we needed, but I can see how it'd be useful.

This is an open-source project, so please feel free to issue a PR to add this, and we'll review and merge it once it's tested.

Most of the magic happens in here: https://github.com/sonalake/utah-parser/blob/master/src/main/java/com/sonalake/utah/config/Config.java#L104

You'd just need to decide whether the default should be used if there's no match, or if it should also be used if the match returns an empty string.

@CptGuo
Copy link
Author

CptGuo commented May 31, 2019

3Q, i will to it myself.
PS: it's a good tool for me;

@daniel-bray-sonalake
Copy link
Collaborator

Glad to help!

@ciarant
Copy link
Contributor

ciarant commented Oct 28, 2021

I'll give this a shot.

daniel-bray-sonalake pushed a commit that referenced this issue Nov 4, 2021
Add Config.getHeaderNames() (#18)
Removed duplicate exception declarations from ExamplesTest
@daniel-bray-sonalake
Copy link
Collaborator

This will be released in version 1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants