Codota Logo
Expression.getExpressionString
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using org.springframework.expression.Expression.getExpressionString (Showing top 20 results out of 531)

  • Common ways to obtain Expression
private void myMethod () {
Expression e =
  • Codota IconSpelExpressionParser parser;String str;parser.parseExpression(str, ParserContext.TEMPLATE_EXPRESSION)
  • Codota IconExpressionParser parser;String expressionString;parser.parseExpression(expressionString)
  • Codota IconSpelExpressionParser parser;String expressionString;parser.parseExpression(expressionString)
  • Smart code suggestions by Codota
}
origin: codecentric/spring-boot-admin

  public String getMessage() {
    return message.getExpressionString();
  }
}
origin: codecentric/spring-boot-admin

public String getMessage() {
  return description.getExpressionString();
}
origin: codecentric/spring-boot-admin

public String getMessage() {
  return message.getExpressionString();
}
origin: codecentric/spring-boot-admin

public String getDescription() {
  return description.getExpressionString();
}
origin: codecentric/spring-boot-admin

public String getDescription() {
  return description.getExpressionString();
}
origin: codecentric/spring-boot-admin

public String getMessage() {
  return message.getExpressionString();
}
origin: spring-projects/spring-security

  @Override
  public String toString() {
    return authorizeExpression.getExpressionString();
  }
}
origin: spring-projects/spring-security

  public static boolean evaluateAsBoolean(Expression expr, EvaluationContext ctx) {
    try {
      return ((Boolean) expr.getValue(ctx, Boolean.class)).booleanValue();
    }
    catch (EvaluationException e) {
      throw new IllegalArgumentException("Failed to evaluate expression '"
          + expr.getExpressionString() + "'", e);
    }
  }
}
origin: spring-projects/spring-security

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    Expression authorize = getAuthorizeExpression();
    Expression filter = getFilterExpression();
    sb.append("[authorize: '").append(
        authorize == null ? "null" : authorize.getExpressionString());
    sb.append("', filter: '")
        .append(filter == null ? "null" : filter.getExpressionString())
        .append("']");
    return sb.toString();
  }
}
origin: spring-projects/spring-security

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    Expression authorize = getAuthorizeExpression();
    Expression filter = getFilterExpression();
    sb.append("[authorize: '").append(
        authorize == null ? "null" : authorize.getExpressionString());
    sb.append("', filter: '").append(
        filter == null ? "null" : filter.getExpressionString());
    sb.append("', filterTarget: '").append(filterTarget).append("']");
    return sb.toString();
  }
}
origin: spring-projects/spring-framework

/**
 * Output an indented representation of the expression syntax tree to the specified output stream.
 * @param printStream the output stream to print into
 * @param expression the expression to be displayed
 */
public static void printAbstractSyntaxTree(PrintStream printStream, Expression expression) {
  printStream.println("===> Expression '" + expression.getExpressionString() + "' - AST start");
  printAST(printStream, ((SpelExpression) expression).getAST(), "");
  printStream.println("===> Expression '" + expression.getExpressionString() + "' - AST end");
}
origin: spring-projects/spring-security

  @Test
  public void toStringUsesExpressionString() {
    when(expression.getExpressionString()).thenReturn("toString");

    assertThat(attribute.toString()).isEqualTo(expression.getExpressionString());
  }
}
origin: spring-projects/spring-security

@Test
public void methodWithPreFilterOnlyIsAllowed() {
  ConfigAttribute[] attrs = mds.getAttributes(voidImpl3).toArray(
      new ConfigAttribute[0]);
  assertThat(attrs).hasSize(1);
  assertThat(attrs[0] instanceof PreInvocationExpressionAttribute).isTrue();
  PreInvocationExpressionAttribute pre = (PreInvocationExpressionAttribute) attrs[0];
  assertThat(pre.getAuthorizeExpression().getExpressionString()).isEqualTo("permitAll");
  assertThat(pre.getFilterExpression()).isNotNull();
  assertThat(pre.getFilterExpression().getExpressionString()).isEqualTo("somePreFilterExpression");
}
origin: spring-projects/spring-security

@Test
public void mixedClassAndMethodPreAnnotationsAreBothIncluded() {
  ConfigAttribute[] attrs = mds.getAttributes(voidImpl2).toArray(
      new ConfigAttribute[0]);
  assertThat(attrs).hasSize(1);
  assertThat(attrs[0] instanceof PreInvocationExpressionAttribute).isTrue();
  PreInvocationExpressionAttribute pre = (PreInvocationExpressionAttribute) attrs[0];
  assertThat(pre.getAuthorizeExpression().getExpressionString()).isEqualTo("someExpression");
  assertThat(pre.getFilterExpression()).isNotNull();
  assertThat(pre.getFilterExpression().getExpressionString()).isEqualTo("somePreFilterExpression");
}
origin: spring-projects/spring-security

@Test
public void methodWithPostFilterOnlyIsAllowed() {
  ConfigAttribute[] attrs = mds.getAttributes(listImpl1).toArray(
      new ConfigAttribute[0]);
  assertThat(attrs).hasSize(2);
  assertThat(attrs[0] instanceof PreInvocationExpressionAttribute).isTrue();
  assertThat(attrs[1] instanceof PostInvocationExpressionAttribute).isTrue();
  PreInvocationExpressionAttribute pre = (PreInvocationExpressionAttribute) attrs[0];
  PostInvocationExpressionAttribute post = (PostInvocationExpressionAttribute) attrs[1];
  assertThat(pre.getAuthorizeExpression().getExpressionString()).isEqualTo("permitAll");
  assertThat(post.getFilterExpression()).isNotNull();
  assertThat(post.getFilterExpression().getExpressionString()).isEqualTo("somePostFilterExpression");
}
origin: spring-projects/spring-security

@Test
public void classAttributesTakesPrecedeceOverInterfaceAttributes() {
  ConfigAttribute[] attrs = mds.getAttributes(notherListImpl2).toArray(
      new ConfigAttribute[0]);
  assertThat(attrs).hasSize(1);
  assertThat(attrs[0] instanceof PreInvocationExpressionAttribute).isTrue();
  PreInvocationExpressionAttribute pre = (PreInvocationExpressionAttribute) attrs[0];
  assertThat(pre.getFilterExpression()).isNotNull();
  assertThat(pre.getAuthorizeExpression()).isNotNull();
  assertThat(pre.getAuthorizeExpression().getExpressionString()).isEqualTo("interfaceMethodAuthzExpression");
  assertThat(pre.getFilterExpression().getExpressionString()).isEqualTo("classMethodPreFilterExpression");
}
origin: spring-projects/spring-security

@Test
public void interfaceAttributesAreIncluded() {
  ConfigAttribute[] attrs = mds.getAttributes(notherListImpl1).toArray(
      new ConfigAttribute[0]);
  assertThat(attrs).hasSize(1);
  assertThat(attrs[0] instanceof PreInvocationExpressionAttribute).isTrue();
  PreInvocationExpressionAttribute pre = (PreInvocationExpressionAttribute) attrs[0];
  assertThat(pre.getFilterExpression()).isNotNull();
  assertThat(pre.getAuthorizeExpression()).isNotNull();
  assertThat(pre.getAuthorizeExpression().getExpressionString()).isEqualTo("interfaceMethodAuthzExpression");
  assertThat(pre.getFilterExpression().getExpressionString()).isEqualTo("interfacePreFilterExpression");
}
origin: spring-projects/spring-security

@Test
public void classLevelPreAnnotationIsPickedUpWhenNoMethodLevelExists()
    throws Exception {
  ConfigAttribute[] attrs = mds.getAttributes(voidImpl1).toArray(
      new ConfigAttribute[0]);
  assertThat(attrs).hasSize(1);
  assertThat(attrs[0] instanceof PreInvocationExpressionAttribute).isTrue();
  PreInvocationExpressionAttribute pre = (PreInvocationExpressionAttribute) attrs[0];
  assertThat(pre.getAuthorizeExpression()).isNotNull();
  assertThat(pre.getAuthorizeExpression().getExpressionString()).isEqualTo("someExpression");
  assertThat(pre.getFilterExpression()).isNull();
}
origin: spring-projects/spring-security

@Test
public void proxyFactoryInterfaceAttributesFound() throws Exception {
  MockMethodInvocation mi = MethodInvocationFactory.createSec2150MethodInvocation();
  Collection<ConfigAttribute> attributes = mds.getAttributes(mi);
  assertThat(attributes).hasSize(1);
  Expression expression = (Expression) ReflectionTestUtils.getField(attributes
      .iterator().next(), "authorizeExpression");
  assertThat(expression.getExpressionString()).isEqualTo("hasRole('ROLE_PERSON')");
}
origin: spring-projects/spring-framework

Expression[] exprs = cse.getExpressions();
assertEquals(3,exprs.length);
assertEquals("listOfNumbersUpToTen.$[#root.listOfNumbersUpToTen.$[#this%2==1]==3]",exprs[1].getExpressionString());
s = ex.getValue(TestScenarioCreator.getTestEvaluationContext(),String.class);
assertEquals("hello  world",s);
org.springframework.expressionExpressiongetExpressionString

Javadoc

Return the original string used to create this expression (unmodified).

Popular methods of Expression

  • getValue
    Evaluate the expression in a specified context which can resolve references to properties, methods,
  • 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
  • isWritable
    Determine if an expression can be written to, i.e. setValue() can be called. The supplied root objec

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • 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
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • BoxLayout (javax.swing)
  • JButton (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now