001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.expression;
016    
017    import com.liferay.portal.kernel.expression.Expression;
018    import com.liferay.portal.kernel.expression.ExpressionFactory;
019    
020    /**
021     * @author Marcellus Tavares
022     */
023    public class ExpressionFactoryImpl implements ExpressionFactory {
024    
025            @Override
026            public Expression<Boolean> createBooleanExpression(
027                    String expressionString) {
028    
029                    return new ExpressionImpl<Boolean>(expressionString, Boolean.class);
030            }
031    
032            @Override
033            public Expression<Double> createDoubleExpression(String expressionString) {
034                    return new ExpressionImpl<Double>(expressionString, Double.class);
035            }
036    
037            @Override
038            public <T> Expression<T> createExpression(
039                    String expressionString, Class<T> expressionType) {
040    
041                    return new ExpressionImpl<T>(expressionString, expressionType);
042            }
043    
044            @Override
045            public Expression<Float> createFloatExpression(String expressionString) {
046                    return new ExpressionImpl<Float>(expressionString, Float.class);
047            }
048    
049            @Override
050            public Expression<Integer> createIntegerExpression(
051                    String expressionString) {
052    
053                    return new ExpressionImpl<Integer>(expressionString, Integer.class);
054            }
055    
056            @Override
057            public Expression<Long> createLongExpression(String expressionString) {
058                    return new ExpressionImpl<Long>(expressionString, Long.class);
059            }
060    
061            @Override
062            public Expression<String> createStringExpression(String expressionString) {
063                    return new ExpressionImpl<String>(expressionString, String.class);
064            }
065    
066    }