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

Generate default impl for abstract function #77

Closed
dhuebner opened this issue Sep 26, 2019 · 1 comment
Closed

Generate default impl for abstract function #77

dhuebner opened this issue Sep 26, 2019 · 1 comment
Assignees

Comments

@dhuebner
Copy link
Contributor

Guice needs a default implementation to inject a class. But we can't use generate once approach or wait until user implements a class.

@ImplementedBy(AddOne.AddOneDummy.class)
public abstract class AddOne implements RosettaFunction {

	/**
	 * @param arg
	 * @param d
	 * @return out
	 */
	public FooDat evaluate(FooDat arg, Date d) {

		FooDat out = doEvaluate(arg, d).build();

		return out;
	}

	protected abstract FooDat.FooDatBuilder doEvaluate(FooDat arg, Date d);


	private static final class AddOneDummy extends AddOne {
		@Override
		protected FooDatBuilder doEvaluate(FooDat arg, Date d) {
			throw new UnsupportedOperationException();
		}
	}
}
@dhuebner
Copy link
Contributor Author

dhuebner commented Oct 1, 2019

Implementeed as part of #85

@dhuebner dhuebner closed this as completed Oct 1, 2019
jim-h-wang pushed a commit that referenced this issue Oct 3, 2019
* All expression generation to use ExpessionGenerator

* Generate default impl for abstract function #77

* New function class structure #85
jim-h-wang pushed a commit that referenced this issue Oct 23, 2019
* Use RosettaExpressionJavaGeneratorForFunctions only #48

* Rename RosettaExpressionJavaGeneratorForFunctions to ExpessionGenerator

* Rename file

* Move RosettaExpressionJavaGenerator to qualify

* Removed last usage of RosettaExpressionJavaGenerator #48

* Generate default impl for abstract function #77

* Adkusted test expectation #77

* All functions to generated abstract java classes #85

* Load annotation.rosetta during tests. Adjusted test expectation #85

* New function class structure #85

* Adapting existing classes for class -> data migration

* Adjusted test expectation #85

* Handle keyed #85

* Event migrated

* migrated model-cdm-event

* Various improvements faced during data migration

* Fixed class cast exception

* Fixed blueprint generator

* Adjusted test expectation

* Migrated model-cdm-product

* Fixed test expectation

* Use wildcard import to fix qualifier and blueprint generators

* Migrated model loader to load RosettaType. Additional Class->Data cases

* Migrating workflow rule Class to Data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant