Get the property name from the expression.

@param expression expression
@return property name
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;
	}
1218531
public static String getGetterName(String propertyName) {
        final String suffix = getSuffixForGetterOrSetter(propertyName);
        return PROPERTY_GET_PREFIX + suffix;
    }
467888
public static ExpressionHandler getHandler(Expression expression) {
        ExpressionHandler ret = null;
        Class<? extends ExpressionHandler> cls = handlers.get(expression.getClass());
        if (cls != null) {
            try {
                Constructor<? extends ExpressionHandler> con = cls.getConstructor(Expression.class);
                ret = con.newInstance(expression);
            } catch (Exception e) {
                log.log(Level.SEVERE, "Failed to instantiate handler for expression '" + expression + "'", e);
            }
        }
        return ret;
    }
362596
private static Expression getExpression(String expression) {
		if (isTemplate(expression)) {
			logger.warn("#{...} syntax is not required for this run-time expression "
					+ "and is deprecated in favor of a simple expression string");
			return new SpelExpressionParser().parseExpression(expression, PARSER_CONTEXT);
		}
		return new SpelExpressionParser().parseExpression(expression);
	}
148226
public String getName(P property)
  {
    Preconditions.checkNotNull(property);
    return converter.convert(property);
  }
808790
public static boolean isFalse(Expression expression) {
        if (expression == null) {
            return false;
        }
        if (expression instanceof PropertyExpression && classNodeImplementsType(((PropertyExpression) expression).getObjectExpression().getType(), Boolean.class)) {
            if (((PropertyExpression) expression).getProperty() instanceof ConstantExpression
                    && "FALSE".equals(((ConstantExpression) ((PropertyExpression) expression).getProperty()).getValue())) {
                return true;
            }
        }
        return ((expression instanceof ConstantExpression) && ((ConstantExpression) expression).isFalseExpression())
                || "Boolean.FALSE".equals(expression.getText());
    }
896307
protected String evaluateExpression(final String expression, final Map<String, ?> values) throws ExpressionEvaluationException {
        
        final Map<String, Object> context = new LinkedHashMap<String, Object>();
        context.putAll(values);
        
        // フォーマッターの追加
        context.computeIfAbsent("formatter", key -> new Formatter());
        
        final String value = expressionLanguage.evaluate(expression, context).toString();
        if(logger.isTraceEnabled()) {
            logger.trace("evaluate expression language: expression='{}' ===> value='{}'", expression, value);
        }
        
        return value;
    }
115867
public String getExpressionString() {
        StringBuffer buf = new StringBuffer();
        for (int i = 0; i < mElements.length; i++) {
            Object elem = mElements[i];
            if (elem instanceof String) {
                buf.append((String) elem);
            } else if (elem instanceof Expression) {
                buf.append("${");
                buf.append(((Expression) elem).getExpressionString());
                buf.append("}");
            }
        }
        return buf.toString();
    }
249469
@SuppressWarnings("unchecked")
    public static <X, Y> PropertyPathExpression<X, Y> getExpression(
            Class<X> source, String propertyPath, Class<Y> valueClass) {
        final PropertyPathExpressionKey key = new PropertyPathExpressionKey(
                source, propertyPath);
        PropertyPathExpression<Object, Object> expression = cache.get(key);

        if (expression == null) {
            expression = new PropertyPathExpression<Object, Object>(
                    (Class<Object>) source, propertyPath);
            final PropertyPathExpression<Object, Object> oldExpression = cache
                    .putIfAbsent(key, expression);

            if (oldExpression != null) {
                expression = oldExpression;
            }
        }

        return (PropertyPathExpression<X, Y>) expression;
    }
723080
public static String propertyNameFromMethodName(Configuration configuration, String name) {
        String propertyName = null;
        if (name.startsWith("get") || name.startsWith("set")) {
            propertyName = name.substring(3);
        } else if (name.startsWith("is")) {
            propertyName = name.substring(2);
        }
        if ((propertyName == null) || propertyName.isEmpty()){
            return "";
        }
        return propertyName.substring(0, 1).toLowerCase(configuration.getLocale())
                + propertyName.substring(1);
    }
536573
public static Query withValue(String expression) {
        String[] parts = split(expression);
        if (parts != null) {
            String field = parts[0];
            String operator = parts[1];
            String value = parts[2];

            BinOp binOp = BinOp.getOp(operator);
            if (binOp != null) {
                return withValue(field, binOp, value);
            }
            NaryOp naryOp = NaryOp.getOp(operator);
            if (naryOp != null) {
                Literal[] values = Literal.values(value.substring(1, value.length() - 1).split("\\s*,\\s*"));
                return withValues(field, naryOp, values);
            }
        }
        throw new IllegalArgumentException("'" + expression + "' is incorrect");
    }
124219
public String resolveExpression(String expression) {
        StringBuilder result = new StringBuilder(expression.length());

        int position = 0;
        while (position < expression.length()) {
            char c = expression.charAt(position);
            if (c == '#') {
                int beginningSeparatorPosition = position;
                int endingSeparatorPosition = expression.indexOf('#', beginningSeparatorPosition + 1);
                if (endingSeparatorPosition == -1) {
                    throw new IllegalStateException("Invalid expression '" + expression + "', no ending '#' after beginning '#' at position " + beginningSeparatorPosition);
                }
                String key = expression.substring(beginningSeparatorPosition + 1, endingSeparatorPosition);
                Callable<String> expressionProcessor = expressionEvaluators.get(key);
                String value;
                if (expressionProcessor == null) {
                    value = "#unsupported_expression#";
                    logger.info("Unsupported expression '" + key + "'");
                } else {
                    try {
                        value = expressionProcessor.call();
                    } catch (Exception e) {
                        value = "#expression_error#";
                        logger.warn("Error evaluating expression '" + key + "'", e);
                    }
                }
                appendEscapedNonAlphaNumericChars(value, false, result);
                position = endingSeparatorPosition + 1;

            } else {
                result.append(c);
                position++;
            }
        }
        logger.trace("resolveExpression({}): {}", expression, result);
        return result.toString();

    }
538790
protected String getParentPropertyName(String propertyName) {
		if (!PropertyAccessorUtils.isIndexedProperty(propertyName)) {
			return "";
		}
		else {
			return propertyName.substring(0, propertyName.lastIndexOf(PROPERTY_KEY_PREFIX_CHAR));
		}
	}
1044137
@NonNull
    public Expression regex(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new BinaryExpression(this, expression, BinaryExpression.OpType.RegexLike);
    }
771342
public Expression create(String expression, ExpressionType expressionType, PropertyResolver propertyResolver) {
        if (expressionType == null) {
            expressionType = ExpressionType.MVEL;
        }
        if (propertyResolver == null) {
            propertyResolver = SystemAndTestPropertyResolver.INSTANCE;
        }
        switch (expressionType) {
        case MVEL:
            return new MVELExpression(expression, propertyResolver);
        default:
            throw CommonKnowledgeMessages.MESSAGES.unknownExpressionType(expressionType.toString());
        }
    }
889797
public static Expression regexpContains(String expression, String pattern) {
        return regexpContains(x(expression), pattern);
    }
361542
public String getValueAsString(Expression expr) throws PageException {
	expr.writeOut(this, Expression.MODE_REF);
	return Caster.toString(stack.pop());
    }