Tabnine Logo
Expression.isWritable
Code IndexAdd Tabnine to your IDE (free)

How to use
isWritable
method
in
org.springframework.expression.Expression

Best Java code snippets using org.springframework.expression.Expression.isWritable (Showing top 13 results out of 315)

origin: spring-projects/spring-framework

@Test
public void testTernaryOperator04() {
  Expression e = parser.parseExpression("1>2?3:4");
  assertFalse(e.isWritable(context));
}
origin: spring-projects/spring-framework

assertFalse("Should not be writable!",e.isWritable(lContext));
  assertFalse("Should not be writable!",e.isWritable(lContext));
  fail("Should have had an error because wibble does not really exist");
assertTrue("Should be writable!",e.isWritable(lContext));
assertFalse("Should not be writable!",e.isWritable(lContext));
  assertFalse("Should not be writable!",e.isWritable(lContext));
  fail("Should have had an error because wibble does not really exist");
  assertFalse("Should not be writable!",e.isWritable(lContext));
  fail("Should have had an error because wibble does not really exist");
origin: spring-projects/spring-framework

@Test
public void testAssign() throws Exception {
  StandardEvaluationContext eContext = TestScenarioCreator.getTestEvaluationContext();
  Expression e = parse("publicName='Andy'");
  assertFalse(e.isWritable(eContext));
  assertEquals("Andy",e.getValue(eContext));
}
origin: spring-projects/spring-framework

  /**
   * For use when coercion is happening during a setValue().  The expectedValue should be
   * the coerced form of the value.
   */
  protected void setValue(String expression, Object value, Object expectedValue) {
    try {
      Expression e = parser.parseExpression(expression);
      if (e == null) {
        fail("Parser returned null for expression");
      }
      if (DEBUG) {
        SpelUtilities.printAbstractSyntaxTree(System.out, e);
      }
      StandardEvaluationContext lContext = TestScenarioCreator.getTestEvaluationContext();
      assertTrue("Expression is not writeable but should be", e.isWritable(lContext));
      e.setValue(lContext, value);
      Object a = expectedValue;
      Object b = e.getValue(lContext);
      if (!a.equals(b)) {
        fail("Not the same: ["+a+"] type="+a.getClass()+"  ["+b+"] type="+b.getClass());
//                assertEquals("Retrieved value was not equal to set value", expectedValue, e.getValue(lContext));
      }
    }
    catch (EvaluationException | ParseException ex) {
      ex.printStackTrace();
      fail("Unexpected Exception: " + ex.getMessage());
    }
  }

origin: spring-projects/spring-framework

protected void setValue(String expression, Object value) {
  try {
    Expression e = parser.parseExpression(expression);
    if (e == null) {
      fail("Parser returned null for expression");
    }
    if (DEBUG) {
      SpelUtilities.printAbstractSyntaxTree(System.out, e);
    }
    StandardEvaluationContext lContext = TestScenarioCreator.getTestEvaluationContext();
    assertTrue("Expression is not writeable but should be", e.isWritable(lContext));
    e.setValue(lContext, value);
    assertEquals("Retrieved value was not equal to set value", value, e.getValue(lContext,value.getClass()));
  }
  catch (EvaluationException | ParseException ex) {
    ex.printStackTrace();
    fail("Unexpected Exception: " + ex.getMessage());
  }
}
origin: spring-projects/spring-framework

    "' but result was of type '" + resultType + "'", expectedClassOfResult.equals(resultType));
boolean isWritable = expr.isWritable(context);
if (isWritable != shouldBeWritable) {
  if (shouldBeWritable)
origin: spring-projects/spring-framework

checkString("hello world", ex.getValue(ctx, new Rooty(), String.class));
assertEquals("hello ${'world'}", ex.getExpressionString());
assertFalse(ex.isWritable(new StandardEvaluationContext()));
assertFalse(ex.isWritable(new Rooty()));
assertFalse(ex.isWritable(new StandardEvaluationContext(), new Rooty()));
origin: spring-projects/spring-integration

public boolean isWritable(Object rootObject) throws EvaluationException {
  return this.resolveExpression().isWritable(rootObject);
}
origin: spring-projects/spring-integration

public boolean isWritable(EvaluationContext context) throws EvaluationException {
  return this.resolveExpression().isWritable(context);
}
origin: spring-projects/spring-integration

public boolean isWritable(EvaluationContext context, Object rootObject) throws EvaluationException {
  return this.resolveExpression().isWritable(context, rootObject);
}
origin: org.springframework.integration/spring-integration-core

public boolean isWritable(Object rootObject) throws EvaluationException {
  return this.resolveExpression().isWritable(rootObject);
}
origin: org.springframework.integration/spring-integration-core

public boolean isWritable(EvaluationContext context) throws EvaluationException {
  return this.resolveExpression().isWritable(context);
}
origin: org.springframework.integration/spring-integration-core

public boolean isWritable(EvaluationContext context, Object rootObject) throws EvaluationException {
  return this.resolveExpression().isWritable(context, rootObject);
}
org.springframework.expressionExpressionisWritable

Javadoc

Determine if an expression can be written to, i.e. setValue() can be called.

Popular methods of Expression

  • getValue
    Evaluate the expression in a specified context which can resolve references to properties, methods,
  • getExpressionString
    Return the original string used to create this expression (unmodified).
  • setValue
    Set this expression in the provided context to the value provided. The supplied root object override
  • getValueType
    Return the most general type that can be passed to the #setValue(EvaluationContext,Object,Object) me
  • getValueTypeDescriptor
    Return the most general type that can be passed to the #setValue(EvaluationContext,Object,Object) me

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JTable (javax.swing)
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now