- JavaDoc

# JEP

- Introduction
- Basic Usage
- Variables
- Data types
- Operators
- Functions
- BigDecimal
- FAQ
- Migration
- Version History

# Advanced Features

- Manipulating Expressions
- Components
- Configurable Parser
- Serialization
- Grammar

# Migrating to JEP 3

JEP 3 brings a number of significant changes with it. So if you are currently running version 2.x, you will need to make some changes to your code. We recommend using JEP 3 as described in this documentation, but we have also provided compatibility classes that ease the transition.

This page gives you tips on performing the migration with or without the compatibility classes.

## Changes that affect migration

The package structure has changed significantly. All classes that were previously in the org.nfunk.jep package are now located under com.singularsys.jep. The organization of the classes has changed significantly as well.

- The main JEP class is now located at com.singularsys.jep.Jep.
- The parseExpression(String) and getValue() methods are now replaced by parse(String) and evaluateD(). The getValueAsObject() method is now replaced by evaluate().
- The hasError() and getErrorInfo() methods have been replaced by exceptions thrown by the parse(String) and evaluate() methods. The parse(String) method throws ParseExceptions and the evaluate() method throws EvaluationExceptions.
- The default constructor Jep() initializes the StandardComponents set which include all the standard functions and constants, no call to addStandardFunctions() or addStandardConstants() is necessary.
- All function classes now throw EvaluationException instead of ParseException.
- The addComplex() method has been removed - the i constant and the complex related methods are now added in StandardVariableTable and StandardFunctionTable when Jep is constructed with the default options (using StandardComponents).
- The SymbolTable class has been renamed to VariableTable.
- The addStandardFunctions() method has been removed. Standard functions are included by default.

## Migrating without compatibility classes

You will need to make changes to your code according to the changes mentioned above. Take special note of the new defaults since they will not necessarily be apparent when compiling your code.

## Migrating with compatibility classes

The compatibility classes include the old org.nfunk.jep.JEP class as well as the old examples and tests. The org.nfunk.jep.JEP implementation uses a JEP 3 instance from com.singularsys.jep.Jep internally to perform the parsing and evaluation. Note that the JEP class has been deprecated and may not be included in future versions of the JEP package.

If you only use the JEP class in your code, your program might compile without making any changes. But if you rely on other classes that have been moved to the new package location, you will need to at least change import statements.