Unable to represent properties that contain '[]' characters #1

Closed
snopoke opened this Issue Nov 3, 2011 · 7 comments

Comments

Projects
None yet
2 participants
@snopoke

snopoke commented Nov 3, 2011

A side effect of the property substitution feature is that you can not have properties that contain character sequences that match the following regular expression:

\\[(.*?)\\]

Examples of properties that would match that regular expression are regular expressions e.g. ^27[78]{1}[0-9]{8}$

@pholser

This comment has been minimized.

Show comment
Hide comment
@pholser

pholser Nov 3, 2011

Owner

True indeed. Do you have a particular resolution in mind? One possibility might be to suppress substitution when asked:

@BoundProperty(substitute = false) String aRegex();

Another possibility might be to allow for delimiter pairs other than the square brackets. Still another would be to acknowledge the limitation and forewarn users via Javadoc or other means.

Eager to hear your thoughts...thanks for your interest!

Owner

pholser commented Nov 3, 2011

True indeed. Do you have a particular resolution in mind? One possibility might be to suppress substitution when asked:

@BoundProperty(substitute = false) String aRegex();

Another possibility might be to allow for delimiter pairs other than the square brackets. Still another would be to acknowledge the limitation and forewarn users via Javadoc or other means.

Eager to hear your thoughts...thanks for your interest!

@pholser

This comment has been minimized.

Show comment
Hide comment
@pholser

pholser Nov 3, 2011

Owner

Another possibility would be to change the delimiters from single square brackets to double square brackets.

Owner

pholser commented Nov 3, 2011

Another possibility would be to change the delimiters from single square brackets to double square brackets.

@pholser

This comment has been minimized.

Show comment
Hide comment
@pholser

pholser Sep 24, 2012

Owner

@snopoke Do you have a preference re: how to allow properties values that contain square brackets?

Owner

pholser commented Sep 24, 2012

@snopoke Do you have a preference re: how to allow properties values that contain square brackets?

@snopoke

This comment has been minimized.

Show comment
Hide comment
@snopoke

snopoke Sep 25, 2012

HI @pholser , sorry for the lack of response to previous questions. I don't really have a preference but I think enabling the user to disable substitution is a good idea and probably including a warning in the Javadoc.

Changing the delimiter would likely break any existing code but its a possibility.

snopoke commented Sep 25, 2012

HI @pholser , sorry for the lack of response to previous questions. I don't really have a preference but I think enabling the user to disable substitution is a good idea and probably including a warning in the Javadoc.

Changing the delimiter would likely break any existing code but its a possibility.

@pholser

This comment has been minimized.

Show comment
Hide comment
@pholser

pholser Sep 25, 2012

Owner

@snopoke Great -- I think I'll take the route of disabling substitution when asked.

Owner

pholser commented Sep 25, 2012

@snopoke Great -- I think I'll take the route of disabling substitution when asked.

pholser added a commit that referenced this issue Feb 19, 2013

Resolving #1 with additional BoundProperty attribute.
Updating copyright dates.

Doing away with Checkstyle -- frustrated with updating its configuration
so that Maven picks up correct config file.

Reformatting slightly -- simple method annotations can go on same line as
the method.
@pholser

This comment has been minimized.

Show comment
Hide comment
@pholser

pholser Feb 20, 2013

Owner

@snopoke Does the above commit meet your needs? Sorry for the extra noise in the commit, and for the long time away.

Owner

pholser commented Feb 20, 2013

@snopoke Does the above commit meet your needs? Sorry for the extra noise in the commit, and for the long time away.

@snopoke

This comment has been minimized.

Show comment
Hide comment
@snopoke

snopoke Feb 21, 2013

hi @pholser. That looks great thanks! I won't have an opportunity to test it out for a bit but I'll let you know if I have any issues.

snopoke commented Feb 21, 2013

hi @pholser. That looks great thanks! I won't have an opportunity to test it out for a bit but I'll let you know if I have any issues.

@snopoke snopoke closed this Feb 21, 2013

pholser added a commit that referenced this issue Apr 3, 2013

For #1, passing substitution and suppression thereof onto...
...MapPropertySource and ResourceBundlePropertySource, if the value in
question is a string.

pholser added a commit that referenced this issue Apr 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment