Tabnine Logo
Expression.getExpressionString
Code IndexAdd Tabnine 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)

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 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 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 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

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • setRequestProperty (URLConnection)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Menu (java.awt)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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