Remove the last property expresson from the current expression.

@param expression The property expression
@return The new expression value, with first property
expression removed - null if there are no more expressions
494806
public String remove(String expression) {
    if (expression == null || expression.length() == 0) { return null; }
    String property = next(expression);
    if (expression.length() == property.length()) { return null; }
    int start = property.length();
    if (expression.charAt(start) == Nested) start++;
    return expression.substring(start);
  }
109001
public static Expression arrayRemove(String expression, Expression value) {
        return arrayRemove(x(expression), value);
    }
685623
public String resolve(String expression) {
    if (isEmpty(expression)) {
      return expression;
    }
    
    // Check if the expression is already been parsed
    if (cache.containsKey(expression)) {
      return cache.get(expression);

    }

    // If the expression does not start with $, then no need to do PATTERN
    if (!expression.startsWith("$")) {

      // Add to the mapping with key and value as expression
      cache.put(expression, expression);

      // If no match, then return the expression as it is
      return expression;

    }

    // Create the matcher
    Matcher matcher = PATTERN.matcher(expression);

    // If the matching is there, then add it to the map and return the value
    if (matcher.find()) {

      // Store the value
      String key = matcher.group(1);

      // Get the value
      String value = environment.getProperty(key);

      // Store the value in the setting
      if (value != null) {

        // Store in the map
        cache.put(expression, value);

        // return the value
        return value;

      }

    }

    // Add to the mapping with key and value as expression
    cache.put(expression, expression);

    // If no match, then return the expression as it is
    return expression;
  }
146434
public void setCronExpression (@Nonnull final String expression) throws ParseException
  {
    final CronExpression newExp = new CronExpression (expression);

    setCronExpression (newExp);
  }
6858
final Expression then(final Expression expression) {
    return new Expression(expression.resultType(), expression.features()) {
      @Override
      protected void doGen(CodeBuilder adapter) {
        Statement.this.gen(adapter);
        expression.gen(adapter);
      }
    };
  }
506059
@NonNull
    public static Expression avg(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new Expression.FunctionExpression("AVG()", Arrays.asList(expression));
    }
671667
public static String substituteValueInExpression(String expression, String newValue)
   {
      ExpressionTemplate t = new ExpressionTemplate(expression);
      if (newValue != null && (getExpressionKey(t.getTemplate()) == null ||
            (t.isComplex()  && !newValue.equals(t.getValue()))))
         return newValue;

      String result = t.getSubstitution();
      if (!t.isComplex() && newValue != null)
      {
         int start = result.lastIndexOf(":$");
         start = result.indexOf(":", start + 1);
         int end = result.indexOf("}", start + 1);

         if (start < 0 || end < 0 || start == result.lastIndexOf("${:}") + 2)
            return result;

         result = result.substring(0, start + 1) + newValue +  result.substring(end);
      }
      return result;
   }
933942
public boolean hasNested(String expression) {
    if (expression == null || expression.length() == 0) return false;
    else return remove(expression) != null;

  }
951692
public static boolean evaluate(final String expression) {
        final Deque<String> operators = new ArrayDeque<>();
        final Deque<String> values = new ArrayDeque<>();
        final boolean result;

        char currentCharacter;
        int currentCharacterIndex = 0;

        try {
            while (currentCharacterIndex < expression.length()) {
                currentCharacter = expression.charAt(currentCharacterIndex);

                if (SeparatorToken.OPEN_PARENTHESIS.value == currentCharacter) {
                    operators.push(SeparatorToken.OPEN_PARENTHESIS.toString());
                    currentCharacterIndex += moveCursor(SeparatorToken.OPEN_PARENTHESIS.toString());
                } else if (SeparatorToken.SPACE.value == currentCharacter) {
                    currentCharacterIndex += moveCursor(SeparatorToken.SPACE.toString());
                } else if (SeparatorToken.CLOSE_PARENTHESIS.value == currentCharacter) {
                    evaluateSubexpression(operators, values);
                    currentCharacterIndex += moveCursor(SeparatorToken.CLOSE_PARENTHESIS.toString());
                } else if (!Character.isDigit(currentCharacter)) {
                    final String parsedNonDigit = parseNonDigits(expression, currentCharacterIndex);
                    if (isBoolean(parsedNonDigit)) {
                        values.push(replaceBooleanStringByIntegerRepresentation(parsedNonDigit));
                    } else {
                        operators.push(validateOperator(parsedNonDigit));
                    }
                    currentCharacterIndex += moveCursor(parsedNonDigit);
                } else if (Character.isDigit(currentCharacter)) {
                    final String parsedDigits = parseDigits(expression, currentCharacterIndex);
                    values.push(parsedDigits);
                    currentCharacterIndex += moveCursor(parsedDigits);
                }
            }

            result = Boolean.valueOf(evaluateExpressionStack(operators, values));

            if (log.isDebugEnabled()) {
                log.debug("Boolean expression {} evaluates to {}", expression, result);
            }
        } catch (final NoSuchElementException e) {
            throw new CitrusRuntimeException("Unable to parse boolean expression '" + expression + "'. Maybe expression is incomplete!", e);
        }

        return result;
    }
504956
public OptionalSyntax where(Expression<?>... expression) {
		for (Expression<?> exp : expression) {
			getMessage().getOptional().add(exp.toString());
			LOG.debug("expression: " + exp);
		}
		QueryMessage mess = getMessage();
		return new OptionalSyntax(mess);
	}
824059
public Cron parse(final String expression) {
        Preconditions.checkNotNull(expression, "Expression must not be null");
        final String replaced = expression.replaceAll("\\s+", " ").trim();
        if (StringUtils.isEmpty(replaced)) {
            throw new IllegalArgumentException("Empty expression!");
        }

        if(expression.contains("|")){
            List<String> crons = new ArrayList<>();
            int cronscount = Arrays.stream(expression.split("\\s+")).mapToInt(s->s.split("\\|").length).max().orElseGet(() -> 0);
            for(int j=0; j<cronscount; j++){
                StringBuilder builder = new StringBuilder();
                for(String s : expression.split("\\s+")){
                    if(s.contains("|")){
                        builder.append(String.format("%s ", s.split("\\|")[j]));
                    }else{
                        builder.append(String.format("%s ", s));
                    }
                }
                crons.add(builder.toString().trim());
            }
            return new CompositeCron(crons.stream().map(c->parse(c)).collect(Collectors.toList()));
        }else{
            final String[] expressionParts = replaced.toUpperCase().split(" ");
            final int expressionLength = expressionParts.length;
            String fieldWithTrailingCommas = Arrays.stream(expressionParts).filter(x -> x.endsWith(",")).findAny().orElse(null);
            if(fieldWithTrailingCommas!=null){
                throw new IllegalArgumentException(String.format("Invalid field value! Trailing commas not permitted! '%s'", fieldWithTrailingCommas));
            }
            final List<CronParserField> fields = expressions.get(expressionLength);
            if (fields == null) {
                throw new IllegalArgumentException(
                        String.format("Cron expression contains %s parts but we expect one of %s", expressionLength, expressions.keySet()));
            }
            try {
                final int size = fields.size();
                final List<CronField> results = new ArrayList<>(size + 1);
                for (int j = 0; j < size; j++) {
                    results.add(fields.get(j).parse(expressionParts[j]));
                }
                return new SingleCron(cronDefinition, results).validate();
            } catch (final IllegalArgumentException e) {
                throw new IllegalArgumentException(String.format("Failed to parse '%s'. %s", expression, e.getMessage()), e);
            }
        }
    }
489302
@NonNull
    public Expression equalTo(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new BinaryExpression(this, expression, BinaryExpression.OpType.EqualTo);
    }
1181660
@Pure
	protected XExpression fromString(String expression) {
		if (!Strings.isEmpty(expression)) {
			ResourceSet resourceSet = this.context.eResource().getResourceSet();
			URI uri = computeUnusedUri(resourceSet);
			Resource resource = getResourceFactory().createResource(uri);
			resourceSet.getResources().add(resource);
			try (StringInputStream is = new StringInputStream(generateExpressionCode(expression))) {
				resource.load(is, null);
				SarlScript script = resource.getContents().isEmpty() ? null : (SarlScript) resource.getContents().get(0);
				SarlEvent topElement = (SarlEvent) script.getXtendTypes().get(0);
				SarlField member = (SarlField) topElement.getMembers().get(0);
				return member.getInitialValue();
			} catch (Throwable exception) {
				throw new RuntimeException(exception);
			} finally {
				resourceSet.getResources().remove(resource);
			}
		}
		throw new IllegalArgumentException("not a valid expression");
	}
1124772
public static boolean isSpreadSafe(Expression expression) {
        if (expression instanceof MethodCallExpression) {
            return ((MethodCallExpression) expression).isSpreadSafe();
        }
        if (expression instanceof PropertyExpression) {
            return ((PropertyExpression) expression).isSpreadSafe();
        }
        return false;
    }
1136484
public FieldExpression parse(final String expression) {
        if (!StringUtils.containsAny(expression, SPECIAL_CHARS_MINUS_STAR)) {
            if (expression.contains(QUESTION_MARK_STRING) && !fieldConstraints.getSpecialChars().contains(QUESTION_MARK)) {
                throw new IllegalArgumentException("Invalid expression: " + expression);
            }

            return noSpecialCharsNorStar(expression);
        } else {
            final String[] array = expression.split(",");
            if (array.length > 1) {
                return commaSplitResult(array);
            } else {
                final String[] splitted = expression.split("-");
                if (expression.contains("-") && splitted.length != 2) {
                    throw new IllegalArgumentException("Missing values for range: " + expression);
                }
                return splitted[0].equalsIgnoreCase(L_STRING)
                        ? parseOnWithL(splitted[0], mapToIntegerFieldValue(splitted[1]))
                        : dashSplitResult(expression, splitted);
            }
        }
    }
773647
private String getPropertyName(Expression expression) {
		if (!(expression instanceof PropertyName)) {
			throw new IllegalArgumentException("Expression " + expression + " is not a PropertyName.");
		}
		String name = ((PropertyName) expression).getPropertyName();
		if (name.endsWith(FilterService.ATTRIBUTE_ID)) {
			// replace by Hibernate id property, always refers to the id, even if named differently
			name = name.substring(0, name.length() - FilterService.ATTRIBUTE_ID.length()) + HIBERNATE_ID;
		}
		return name;
	}
1185705
public final CALC expression(String expression) throws ParseException {
        detectImplmentedExtension();
        
        if (infixParser == null)
            infixParser = new InfixParser();
        
        CList infix = infixParser.parse(useExtensions, getProperties(), expression);
        expression(infix, false);
        return getThis();
    }