[jira] [Comment Edited] (JEXL-314) Comparison NULL values of variables NAME1.NAME2
[ https://issues.apache.org/jira/browse/JEXL-314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16929252#comment-16929252 ] Osy edited comment on JEXL-314 at 9/13/19 2:39 PM: --- I have an error trying to set engine to safe {code:java} JexlEngine jexl = new JexlBuilder().strict(true).safe(true).create();{code} *The method safe(boolean) is undefined for the type JexlBuilder* was (Author: osymad): I have an error trying to set engine to safe JexlEngine jexl = new JexlBuilder().strict(true).safe(true).create(); *The method safe(boolean) is undefined for the type JexlBuilder* > Comparison NULL values of variables NAME1.NAME2 > --- > > Key: JEXL-314 > URL: https://issues.apache.org/jira/browse/JEXL-314 > Project: Commons JEXL > Issue Type: Wish >Affects Versions: 3.1 >Reporter: Osy >Priority: Minor > > I am adding to my context this NULL variable : > > {code:java} > jc.set("TVALOGAR.PEPITO", null); > jexlExp = "TVALOGAR.PEPITO==null?'SIMON':'SIMONAZO'"; > {code} > After evaluate the jexlExp I get the error: > *Exception in thread "main" org.apache.commons.jexl3.JexlException$Variable: > com.expre.test.TestJexl.main@1:1 null value variable TVALOGAR.PEPITO* > > This is not happening If I am using only a simple variable name: > {code:java} > jc.set("TVALOGAR", null); > jexlExp = "TVALOGAR==null?'SIMON':'SIMONAZO'"; > {code} > *Expression Value :SIMON* > Is this the expected behaviour? > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (JEXL-314) Comparison NULL values of variables NAME1.NAME2
[ https://issues.apache.org/jira/browse/JEXL-314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16929252#comment-16929252 ] Osy commented on JEXL-314: -- I have an error trying to set engine to safe JexlEngine jexl = new JexlBuilder().strict(true).safe(true).create(); *The method safe(boolean) is undefined for the type JexlBuilder* > Comparison NULL values of variables NAME1.NAME2 > --- > > Key: JEXL-314 > URL: https://issues.apache.org/jira/browse/JEXL-314 > Project: Commons JEXL > Issue Type: Wish >Affects Versions: 3.1 >Reporter: Osy >Priority: Minor > > I am adding to my context this NULL variable : > > {code:java} > jc.set("TVALOGAR.PEPITO", null); > jexlExp = "TVALOGAR.PEPITO==null?'SIMON':'SIMONAZO'"; > {code} > After evaluate the jexlExp I get the error: > *Exception in thread "main" org.apache.commons.jexl3.JexlException$Variable: > com.expre.test.TestJexl.main@1:1 null value variable TVALOGAR.PEPITO* > > This is not happening If I am using only a simple variable name: > {code:java} > jc.set("TVALOGAR", null); > jexlExp = "TVALOGAR==null?'SIMON':'SIMONAZO'"; > {code} > *Expression Value :SIMON* > Is this the expected behaviour? > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Created] (JEXL-314) Comparison NULL values of variables NAME1.NAME2
Osy created JEXL-314: Summary: Comparison NULL values of variables NAME1.NAME2 Key: JEXL-314 URL: https://issues.apache.org/jira/browse/JEXL-314 Project: Commons JEXL Issue Type: Wish Affects Versions: 3.1 Reporter: Osy I am adding to my context this NULL variable : {code:java} jc.set("TVALOGAR.PEPITO", null); jexlExp = "TVALOGAR.PEPITO==null?'SIMON':'SIMONAZO'"; {code} After evaluate the jexlExp I get the error: *Exception in thread "main" org.apache.commons.jexl3.JexlException$Variable: com.expre.test.TestJexl.main@1:1 null value variable TVALOGAR.PEPITO* This is not happening If I am using only a simple variable name: {code:java} jc.set("TVALOGAR", null); jexlExp = "TVALOGAR==null?'SIMON':'SIMONAZO'"; {code} *Expression Value :SIMON* Is this the expected behaviour? -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Closed] (JEXL-313) Can one expression return a Float even when its elements are Integer?
[ https://issues.apache.org/jira/browse/JEXL-313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Osy closed JEXL-313. Resolution: Implemented Extending JexlArithmetic worked perfectly! Indeed only overrriding *divide* , the only case identified where was required. {code:java} public class ExtendedJexlArithmetic extends JexlArithmetic{ public ExtendedJexlArithmetic(boolean astrict) { super(astrict); } public Object divide(Object left, Object right) { if(left instanceof Integer && right instanceof Integer) return BigDecimal.valueOf((int) left).divide(BigDecimal.valueOf((int) right)); return super.divide(left, right); } } {code} Thanks again [~henrib] > Can one expression return a Float even when its elements are Integer? > - > > Key: JEXL-313 > URL: https://issues.apache.org/jira/browse/JEXL-313 > Project: Commons JEXL > Issue Type: Wish >Affects Versions: 3.1 >Reporter: Osy >Priority: Minor > > For example a simple expression like "3/2" or another like > "((10/10)*(100/2)/(100*(10+1)))" are always returning an Integer result. > But I want to maintain sme syntax without add decimal part to any number or a > letter to qualify the number type. > I mean, I want to still using *"3/2"* instead "3.0/2" or "3D/2" to get a > Float - or decimal - result. > It is possible? -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Created] (JEXL-313) Can one expression return a Float even when its elements are Integer?
Osy created JEXL-313: Summary: Can one expression return a Float even when its elements are Integer? Key: JEXL-313 URL: https://issues.apache.org/jira/browse/JEXL-313 Project: Commons JEXL Issue Type: Wish Affects Versions: 3.1 Reporter: Osy For example a simple expression like "3/2" or another like "((10/10)*(100/2)/(100*(10+1)))" are always returning an Integer result. But I want to maintain sme syntax without add decimal part to any number or a letter to qualify the number type. I mean, I want to still using *"3/2"* instead "3.0/2" or "3D/2" to get a Float - or decimal - result. It is possible? -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Closed] (JEXL-310) Define Alias or synonyms for Methods with parameters and accesible through Jexl Context
[ https://issues.apache.org/jira/browse/JEXL-310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Osy closed JEXL-310. Resolution: Fixed > Define Alias or synonyms for Methods with parameters and accesible through > Jexl Context > > > Key: JEXL-310 > URL: https://issues.apache.org/jira/browse/JEXL-310 > Project: Commons JEXL > Issue Type: Wish >Affects Versions: 3.1 >Reporter: Osy >Priority: Trivial > > I have a static method: > *Util.round : public static Object round(Object number, Object places)* > I can access this Method within an expression adding the class to the context > *jexlContext.set("util", new Util());* > And using an expression as *: util.round(34.678,2)*** > However -within the jexl expression - I don't want to access the method round > as : > *util.round(34.678,2),* instead I want to use the method with my own name: > +*$$ROUND**(34.678,2)*+** > It is possible? > > > > > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Commented] (JEXL-310) Define Alias or synonyms for Methods with parameters and accesible through Jexl Context
[ https://issues.apache.org/jira/browse/JEXL-310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16910841#comment-16910841 ] Osy commented on JEXL-310: -- Thanks [~henrib], worked! > Define Alias or synonyms for Methods with parameters and accesible through > Jexl Context > > > Key: JEXL-310 > URL: https://issues.apache.org/jira/browse/JEXL-310 > Project: Commons JEXL > Issue Type: Wish >Affects Versions: 3.1 >Reporter: Osy >Priority: Trivial > > I have a static method: > *Util.round : public static Object round(Object number, Object places)* > I can access this Method within an expression adding the class to the context > *jexlContext.set("util", new Util());* > And using an expression as *: util.round(34.678,2)*** > However -within the jexl expression - I don't want to access the method round > as : > *util.round(34.678,2),* instead I want to use the method with my own name: > +*$$ROUND**(34.678,2)*+** > It is possible? > > > > > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Created] (JEXL-310) Define Alias or synonyms for Methods with parameters and accesible through Jexl Context
Osy created JEXL-310: Summary: Define Alias or synonyms for Methods with parameters and accesible through Jexl Context Key: JEXL-310 URL: https://issues.apache.org/jira/browse/JEXL-310 Project: Commons JEXL Issue Type: Wish Affects Versions: 3.1 Reporter: Osy I have a static method: *Util.round : public static Object round(Object number, Object places)* I can access this Method within an expression adding the class to the context *jexlContext.set("util", new Util());* And using an expression as *: util.round(34.678,2)*** However -within the jexl expression - I don't want to access the method round as : *util.round(34.678,2),* instead I want to use the method with my own name: +*$$ROUND**(34.678,2)*+** It is possible? -- This message was sent by Atlassian JIRA (v7.6.14#76016)
[jira] [Updated] (JEXL-284) Break down recursive expressions- Handy print
[ https://issues.apache.org/jira/browse/JEXL-284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Osy updated JEXL-284: - Summary: Break down recursive expressions- Handy print (was: Break down recursive expressions) > Break down recursive expressions- Handy print > - > > Key: JEXL-284 > URL: https://issues.apache.org/jira/browse/JEXL-284 > Project: Commons JEXL > Issue Type: New Feature >Affects Versions: 3.1 >Reporter: Osy >Priority: Minor > > It is possible to break down JEXL expressions in order to know how each > element (operand) was resolved? > Example : > EXP1 = A * B + C + 200 > C = D * F / 2 + FUNCTION(X,Y) > My whish is to print all the values involved in the expression resolution in > a handy print to understand the whole expression elements. > Something like :( > > -EXP1 > ---A > 1 > ---B > 2 > --C > D > F > 2 > FUNCTION(X,Y) > --X > -3 > --Y > -4 > 34 > --200 > - > > Thanks > > > > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (JEXL-284) Break down recursive expressions
Osy created JEXL-284: Summary: Break down recursive expressions Key: JEXL-284 URL: https://issues.apache.org/jira/browse/JEXL-284 Project: Commons JEXL Issue Type: New Feature Affects Versions: 3.1 Reporter: Osy It is possible to break down JEXL expressions in order to know how each element (operand) was resolved? Example : EXP1 = A * B + C + 200 C = D * F / 2 + FUNCTION(X,Y) My whish is to print all the values involved in the expression resolution in a handy print to understand the whole expression elements. Something like :( -EXP1 ---A 1 ---B 2 --C D F 2 FUNCTION(X,Y) --X -3 --Y -4 34 --200 - Thanks -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (JEXL-258) JEXL unset method
[ https://issues.apache.org/jira/browse/JEXL-258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Osy updated JEXL-258: - Description: Currently we have a set method to put in context a new expresion variable. *void org.apache.commons.jexl3.JexlContext.set(String arg0, Object arg1)* However, I have the need of clean some variables for each Iteration, so please analyze if is possible to add an unset method to do the opposite action to set method. was: Currently we have a set method to put in context a new expresion variable. *void [org|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg].[apache|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache].[commons|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons].[jexl3|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons.jexl3].[JexlContext|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons.jexl3(JexlContext.class%E2%98%83JexlContext].set([String|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons.jexl3(JexlContext.class%E2%98%83JexlContext~set~Ljava.lang.String;~Ljava.lang.Object;%E2%98%82java.lang.String] arg0, [Object|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons.jexl3(JexlContext.class%E2%98%83JexlContext~set~Ljava.lang.String;~Ljava.lang.Object;%E2%98%82java.lang.Object] arg1)* However, I have the need of clean some variables for each Iteration, so please analyze if is possible to add an unset method to do the opposite action to set method. > JEXL unset method > - > > Key: JEXL-258 > URL: https://issues.apache.org/jira/browse/JEXL-258 > Project: Commons JEXL > Issue Type: Improvement >Affects Versions: 3.1 >Reporter: Osy >Priority: Minor > > Currently we have a set method to put in context a new expresion variable. > > *void org.apache.commons.jexl3.JexlContext.set(String arg0, Object arg1)* > > However, I have the need of clean some variables for each Iteration, so > please analyze if is possible to add an unset method to do the opposite > action to set method. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (JEXL-258) JEXL unset method
Osy created JEXL-258: Summary: JEXL unset method Key: JEXL-258 URL: https://issues.apache.org/jira/browse/JEXL-258 Project: Commons JEXL Issue Type: Improvement Affects Versions: 3.1 Reporter: Osy Currently we have a set method to put in context a new expresion variable. *void [org|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg].[apache|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache].[commons|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons].[jexl3|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons.jexl3].[JexlContext|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons.jexl3(JexlContext.class%E2%98%83JexlContext].set([String|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons.jexl3(JexlContext.class%E2%98%83JexlContext~set~Ljava.lang.String;~Ljava.lang.Object;%E2%98%82java.lang.String] arg0, [Object|eclipse-javadoc:%E2%98%82=IceExpre/C:%5C/Users%5C/ossoto%5C/.m2%5C/repository%5C/org%5C/apache%5C/commons%5C/commons-jexl3%5C/3.1%5C/commons-jexl3-3.1.jar%3Corg.apache.commons.jexl3(JexlContext.class%E2%98%83JexlContext~set~Ljava.lang.String;~Ljava.lang.Object;%E2%98%82java.lang.Object] arg1)* However, I have the need of clean some variables for each Iteration, so please analyze if is possible to add an unset method to do the opposite action to set method. -- This message was sent by Atlassian JIRA (v7.6.3#76005)