All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.tsl2.nano.bean.def.IValueExpression Maven / Gradle / Ivy

Go to download

TSL2 Framework Descriptor (currency-handling, generic formatter, descriptors for beans, collections, actions and values)

There is a newer version: 2.5.1
Show newest version
/*
 * File: $HeadURL$
 * Id  : $Id$
 * 
 * created by: Tom
 * created on: 21.02.2014
 * 
 * Copyright: (c) Thomas Schneider 2014, all rights reserved
 */
package de.tsl2.nano.bean.def;

import de.tsl2.nano.core.cls.BeanAttribute;

/**
 * base definition for all calculation attributes like rules or sql-statements.
 * 
 * @author Tom
 * @version $Revision$
 */
public interface IValueExpression {

    String getName();
    /**
     * optional expression description
     * 
     * @return the expression pattern
     */
    String getExpressionPattern();

    /**
     * getExpression
     * 
     * @return the defined expression or null
     */
    String getExpression();

    /**
     * if you set a value expression (see {@link ValueExpression}, the value returned by {@link #getValue(Object)} will
     * be evaluated through call of {@link ValueExpression#from(String)} - not through standard mechanism
     * {@link BeanAttribute#getValue(Object)}.
     * 
     * @param valueExpression string representation of a new {@link ValueExpression}.
     */
    void setExpression(String valueExpression);

    /**
     * getType
     * 
     * @return type of value evaluated through expression
     */
    Class getType();

    /**
     * getValue
     * 
     * @param instance
     * @return value evaluated through expression using given instance
     */
    T getValue(Object instance);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy