Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor pure dialects #677

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.time.ZonedDateTime;

/**
* @deprecated As of release 8.3.0, replaced by {@link PureJavaTimeDMNDialectDefinition}
* @deprecated As of release 8.3.0, replaced by {@link JavaTimeDMNDialectDefinition}
*/
@Deprecated
public class DoubleMixedJavaTimeDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<Double, LocalDate, OffsetTime, ZonedDateTime, Duration> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import java.time.ZonedDateTime;

/**
* @deprecated As of release 8.3.0, replaced by {@link PureJavaTimeKotlinStandardDMNDialectDefinition}
* @deprecated As of release 8.3.0, replaced by {@link JavaTimeKotlinStandardDMNDialectDefinition}
*/
@Deprecated
public class DoubleMixedJavaTimeKotlinStandardDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<Double, LocalDate, OffsetTime, ZonedDateTime, Duration> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
import com.gs.dmn.DMNModelRepository;
import com.gs.dmn.context.environment.EnvironmentFactory;
import com.gs.dmn.feel.lib.FEELLib;
import com.gs.dmn.feel.lib.PureJavaTimeFEELLib;
import com.gs.dmn.feel.lib.JavaTimeFEELLib;
import com.gs.dmn.feel.synthesis.type.JavaTimeNativeTypeFactory;
import com.gs.dmn.feel.synthesis.type.NativeTypeFactory;
import com.gs.dmn.feel.synthesis.type.PureJavaTimeNativeTypeFactory;
import com.gs.dmn.log.BuildLogger;
import com.gs.dmn.runtime.PureJavaTimeDMNBaseDecision;
import com.gs.dmn.runtime.JavaTimeDMNBaseDecision;
import com.gs.dmn.serialization.TypeDeserializationConfigurer;
import com.gs.dmn.tck.ast.TestCases;
import com.gs.dmn.transformation.DMNToJavaTransformer;
Expand All @@ -37,7 +37,7 @@
import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalAmount;

public class PureJavaTimeDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
public class JavaTimeDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
//
// DMN Processors
//
Expand All @@ -57,17 +57,17 @@ public BasicDMNToJavaTransformer createBasicTransformer(DMNModelRepository repos
//
@Override
public NativeTypeFactory createNativeTypeFactory() {
return new PureJavaTimeNativeTypeFactory();
return new JavaTimeNativeTypeFactory();
}

@Override
public FEELLib<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> createFEELLib() {
return new PureJavaTimeFEELLib();
return new JavaTimeFEELLib();
}

@Override
public String getDecisionBaseClass() {
return PureJavaTimeDMNBaseDecision.class.getName();
return JavaTimeDMNBaseDecision.class.getName();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
import com.gs.dmn.DMNModelRepository;
import com.gs.dmn.context.environment.EnvironmentFactory;
import com.gs.dmn.feel.lib.FEELLib;
import com.gs.dmn.feel.lib.PureJavaTimeFEELLib;
import com.gs.dmn.feel.lib.JavaTimeFEELLib;
import com.gs.dmn.feel.synthesis.type.JavaTimeKotlinNativeTypeFactory;
import com.gs.dmn.feel.synthesis.type.NativeTypeFactory;
import com.gs.dmn.feel.synthesis.type.PureJavaTimeKotlinNativeTypeFactory;
import com.gs.dmn.log.BuildLogger;
import com.gs.dmn.runtime.PureJavaTimeDMNBaseDecision;
import com.gs.dmn.runtime.JavaTimeDMNBaseDecision;
import com.gs.dmn.serialization.TypeDeserializationConfigurer;
import com.gs.dmn.tck.ast.TestCases;
import com.gs.dmn.transformation.DMNToKotlinTransformer;
Expand All @@ -39,7 +39,7 @@
import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalAmount;

public class PureJavaTimeKotlinStandardDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
public class JavaTimeKotlinStandardDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
//
// DMN Processors
//
Expand All @@ -59,17 +59,17 @@ public BasicDMNToJavaTransformer createBasicTransformer(DMNModelRepository repos
//
@Override
public NativeTypeFactory createNativeTypeFactory() {
return new PureJavaTimeKotlinNativeTypeFactory();
return new JavaTimeKotlinNativeTypeFactory();
}

@Override
public FEELLib<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> createFEELLib() {
return new PureJavaTimeFEELLib();
return new JavaTimeFEELLib();
}

@Override
public String getDecisionBaseClass() {
return PureJavaTimeDMNBaseDecision.class.getName();
return JavaTimeDMNBaseDecision.class.getName();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.gs.dmn.DMNModelRepository;
import com.gs.dmn.context.environment.EnvironmentFactory;
import com.gs.dmn.feel.lib.FEELLib;
import com.gs.dmn.feel.lib.PureJavaTimeFEELLib;
import com.gs.dmn.feel.lib.JavaTimeFEELLib;
import com.gs.dmn.feel.synthesis.type.NativeTypeFactory;
import com.gs.dmn.feel.synthesis.type.StandardNativeTypeToPythonFactory;
import com.gs.dmn.log.BuildLogger;
Expand All @@ -37,7 +37,7 @@
import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalAmount;

public class PythonStandardDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
public class JavaTimePythonStandardDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
//
// DMN Processors
//
Expand All @@ -62,7 +62,7 @@ public NativeTypeFactory createNativeTypeFactory() {

@Override
public FEELLib<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> createFEELLib() {
return new PureJavaTimeFEELLib();
return new JavaTimeFEELLib();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.math.BigDecimal;

/**
* @deprecated As of release 8.3.0, replaced by {@link PureJavaTimeKotlinStandardDMNDialectDefinition}
* @deprecated As of release 8.3.0, replaced by {@link JavaTimeKotlinStandardDMNDialectDefinition}
*/
@Deprecated
public class KotlinStandardDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, XMLGregorianCalendar, XMLGregorianCalendar, XMLGregorianCalendar, Duration> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import java.time.ZonedDateTime;

/**
* @deprecated As of release 8.3.0, replaced by {@link PureJavaTimeDMNDialectDefinition}
* @deprecated As of release 8.3.0, replaced by {@link JavaTimeDMNDialectDefinition}
*/
@Deprecated
public class MixedJavaTimeDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, LocalDate, OffsetTime, ZonedDateTime, Duration> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import java.time.ZonedDateTime;

/**
* @deprecated As of release 8.3.0, replaced by {@link PureJavaTimeKotlinStandardDMNDialectDefinition}
* @deprecated As of release 8.3.0, replaced by {@link JavaTimeKotlinStandardDMNDialectDefinition}
*/
@Deprecated
public class MixedJavaTimeKotlinStandardDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, LocalDate, OffsetTime, ZonedDateTime, Duration> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.math.BigDecimal;

/**
* @deprecated As of release 8.3.0, replaced by {@link PureJavaTimeDMNDialectDefinition}
* @deprecated As of release 8.3.0, replaced by {@link JavaTimeDMNDialectDefinition}
*/
@Deprecated
public class StandardDMNDialectDefinition extends AbstractStandardDMNDialectDefinition<BigDecimal, XMLGregorianCalendar, XMLGregorianCalendar, XMLGregorianCalendar, Duration> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static com.gs.dmn.feel.analysis.semantics.type.StringType.STRING;
import static com.gs.dmn.feel.analysis.semantics.type.TimeType.TIME;

public class PureJavaTimeKotlinNativeTypeFactory extends KotlinTypeFactory {
public class JavaTimeKotlinNativeTypeFactory extends KotlinTypeFactory {
private static final Map<String, String> FEEL_TYPE_TO_JAVA_TYPE = new LinkedHashMap<>();
static {
FEEL_TYPE_TO_JAVA_TYPE.put(ENUMERATION.getName(), String.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static com.gs.dmn.feel.analysis.semantics.type.StringType.STRING;
import static com.gs.dmn.feel.analysis.semantics.type.TimeType.TIME;

public class PureJavaTimeNativeTypeFactory extends JavaTypeFactory {
public class JavaTimeNativeTypeFactory extends JavaTypeFactory {
private static final Map<String, String> FEEL_TYPE_TO_JAVA_TYPE = new LinkedHashMap<>();
static {
FEEL_TYPE_TO_JAVA_TYPE.put(ENUMERATION.getName(), String.class.getSimpleName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*/
package com.gs.dmn.dialect;

import com.gs.dmn.feel.lib.PureJavaTimeFEELLib;
import com.gs.dmn.feel.synthesis.type.PureJavaTimeNativeTypeFactory;
import com.gs.dmn.runtime.PureJavaTimeDMNBaseDecision;
import com.gs.dmn.feel.lib.JavaTimeFEELLib;
import com.gs.dmn.feel.synthesis.type.JavaTimeNativeTypeFactory;
import com.gs.dmn.runtime.JavaTimeDMNBaseDecision;
import com.gs.dmn.runtime.interpreter.StandardDMNInterpreter;
import com.gs.dmn.tck.ast.TestCases;
import com.gs.dmn.transformation.DMNToJavaTransformer;
Expand All @@ -25,10 +25,10 @@
import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalAmount;

public class PureJavaTimeDMNDialectDefinitionTest extends AbstractStandardDMNDialectDefinitionTest<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
public class JavaTimeDMNDialectDefinitionTest extends AbstractStandardDMNDialectDefinitionTest<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
@Override
protected DMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount, TestCases> makeDialect() {
return new PureJavaTimeDMNDialectDefinition();
return new JavaTimeDMNDialectDefinition();
}

@Override
Expand All @@ -48,16 +48,16 @@ protected String getBasicTransformerClass() {

@Override
protected String getExpectedNativeTypeFactoryClass() {
return PureJavaTimeNativeTypeFactory.class.getName();
return JavaTimeNativeTypeFactory.class.getName();
}

@Override
protected String getExpectedFEELLibClass() {
return PureJavaTimeFEELLib.class.getName();
return JavaTimeFEELLib.class.getName();
}

@Override
protected String getExpectedDecisionBaseClass() {
return PureJavaTimeDMNBaseDecision.class.getName();
return JavaTimeDMNBaseDecision.class.getName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*/
package com.gs.dmn.dialect;

import com.gs.dmn.feel.lib.PureJavaTimeFEELLib;
import com.gs.dmn.feel.synthesis.type.PureJavaTimeKotlinNativeTypeFactory;
import com.gs.dmn.runtime.PureJavaTimeDMNBaseDecision;
import com.gs.dmn.feel.lib.JavaTimeFEELLib;
import com.gs.dmn.feel.synthesis.type.JavaTimeKotlinNativeTypeFactory;
import com.gs.dmn.runtime.JavaTimeDMNBaseDecision;
import com.gs.dmn.runtime.interpreter.StandardDMNInterpreter;
import com.gs.dmn.tck.ast.TestCases;
import com.gs.dmn.transformation.DMNToKotlinTransformer;
Expand All @@ -25,10 +25,10 @@
import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalAmount;

public class PureJavaTimeKotlinStandardDMNDialectDefinitionTest extends AbstractStandardDMNDialectDefinitionTest<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
public class JavaTimeKotlinStandardDMNDialectDefinitionTest extends AbstractStandardDMNDialectDefinitionTest<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
@Override
protected DMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount, TestCases> makeDialect() {
return new PureJavaTimeKotlinStandardDMNDialectDefinition();
return new JavaTimeKotlinStandardDMNDialectDefinition();
}

@Override
Expand All @@ -48,16 +48,16 @@ protected String getBasicTransformerClass() {

@Override
protected String getExpectedNativeTypeFactoryClass() {
return PureJavaTimeKotlinNativeTypeFactory.class.getName();
return JavaTimeKotlinNativeTypeFactory.class.getName();
}

@Override
protected String getExpectedFEELLibClass() {
return PureJavaTimeFEELLib.class.getName();
return JavaTimeFEELLib.class.getName();
}

@Override
protected String getExpectedDecisionBaseClass() {
return PureJavaTimeDMNBaseDecision.class.getName();
return JavaTimeDMNBaseDecision.class.getName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
package com.gs.dmn.feel;

import com.gs.dmn.dialect.DMNDialectDefinition;
import com.gs.dmn.dialect.PureJavaTimeDMNDialectDefinition;
import com.gs.dmn.dialect.JavaTimeDMNDialectDefinition;
import com.gs.dmn.tck.ast.TestCases;
import org.junit.jupiter.api.Test;

Expand All @@ -25,10 +25,10 @@
import java.util.Arrays;
import java.util.List;

public class PureJavaFEELProcessorTest extends AbstractStandardFEELProcessorTest<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
public class JavaFEELProcessorTest extends AbstractStandardFEELProcessorTest<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount> {
@Override
protected DMNDialectDefinition<BigDecimal, LocalDate, TemporalAccessor, TemporalAccessor, TemporalAmount, TestCases> makeDialect() {
return new PureJavaTimeDMNDialectDefinition();
return new JavaTimeDMNDialectDefinition();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.gs.dmn.context.DMNContextKind;
import com.gs.dmn.context.environment.EnvironmentFactory;
import com.gs.dmn.context.environment.RuntimeEnvironment;
import com.gs.dmn.dialect.PureJavaTimeDMNDialectDefinition;
import com.gs.dmn.dialect.JavaTimeDMNDialectDefinition;
import com.gs.dmn.el.analysis.semantics.type.Type;
import com.gs.dmn.el.synthesis.ELTranslator;
import com.gs.dmn.el.synthesis.triple.Triple;
Expand Down Expand Up @@ -40,7 +40,7 @@ public class FEELToTripleNativeVisitorTest extends AbstractTest {
private FEELToTripleNativeVisitor nativeVisitor;

public FEELToTripleNativeVisitorTest() {
PureJavaTimeDMNDialectDefinition dialectDefinition = new PureJavaTimeDMNDialectDefinition();
JavaTimeDMNDialectDefinition dialectDefinition = new JavaTimeDMNDialectDefinition();
DMNModelRepository repository = makeRepository();
InputParameters inputParameters = makeInputParameters();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import org.junit.jupiter.api.Test;

public abstract class CL2SDMNInterpreterTest<NUMBER, DATE, TIME, DATE_TIME, DURATION> extends AbstractDMNInterpreterTest<NUMBER, DATE, TIME, DATE_TIME, DURATION> {
public abstract class AbstractCL2SDMNInterpreterTest<NUMBER, DATE, TIME, DATE_TIME, DURATION> extends AbstractDMNInterpreterTest<NUMBER, DATE, TIME, DATE_TIME, DURATION> {
@Override
protected String getDMNInputPath() {
return "tck/%s/cl2/%s/translator";
Expand Down
Loading
Loading