-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #612 from opatrascoiu/master-refactor
Master refactor
- Loading branch information
Showing
325 changed files
with
5,327 additions
and
3,831 deletions.
There are no files selected for viewing
81 changes: 0 additions & 81 deletions
81
dmn-core/src/main/java/com/gs/dmn/ast/DMNVersionTransformerVisitor.java
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
dmn-core/src/main/java/com/gs/dmn/ast/ReferenceVisitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright 2016 Goldman Sachs. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. | ||
* | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package com.gs.dmn.ast; | ||
|
||
import com.gs.dmn.DRGElementReference; | ||
import com.gs.dmn.runtime.DMNRuntimeException; | ||
|
||
public interface ReferenceVisitor<C, R> { | ||
// References | ||
default R visit(DRGElementReference<? extends TDRGElement> reference, C context) { | ||
TDRGElement element = reference.getElement(); | ||
R result; | ||
if (element == null) { | ||
result = null; | ||
} else if (element instanceof TInputData) { | ||
result = visitInputReference((DRGElementReference<TInputData>) reference, context); | ||
} else if (element instanceof TDecision) { | ||
result = visitDecisionReference((DRGElementReference<TDecision>) reference, context); | ||
} else if (element instanceof TBusinessKnowledgeModel) { | ||
result = visitBKMReference((DRGElementReference<TBusinessKnowledgeModel>) reference, context); | ||
} else if (element instanceof TDecisionService) { | ||
result = visitDSReference((DRGElementReference<TDecisionService>) reference, context); | ||
} else if (element instanceof TKnowledgeSource) { | ||
result = visitSourceReference((DRGElementReference<TKnowledgeSource>) reference, context); | ||
} else { | ||
throw new DMNRuntimeException(String.format("Not supported for class '%s'", element.getClass().getSimpleName())); | ||
} | ||
return result; | ||
} | ||
|
||
default R visitInvocable(DRGElementReference<? extends TInvocable> reference, C context) { | ||
TInvocable element = reference.getElement(); | ||
R result; | ||
if (element == null) { | ||
throw new DMNRuntimeException(String.format("Cannot visit invocable '%s'", reference)); | ||
} else if (element instanceof TBusinessKnowledgeModel) { | ||
result = visitBKMReference((DRGElementReference<TBusinessKnowledgeModel>) reference, context); | ||
} else if (element instanceof TDecisionService) { | ||
result = visitDSReference((DRGElementReference<TDecisionService>) reference, context); | ||
} else { | ||
throw new DMNRuntimeException(String.format("Not supported type '%s'", element.getClass().getSimpleName())); | ||
} | ||
return result; | ||
} | ||
|
||
default R visitInputReference(DRGElementReference<TInputData> reference, C context) { | ||
return null; | ||
} | ||
|
||
default R visitDecisionReference(DRGElementReference<TDecision> reference, C context) { | ||
return null; | ||
} | ||
|
||
default R visitBKMReference(DRGElementReference<TBusinessKnowledgeModel> reference, C context) { | ||
return null; | ||
} | ||
|
||
default R visitDSReference(DRGElementReference<TDecisionService> reference, C context) { | ||
return null; | ||
} | ||
|
||
default R visitSourceReference(DRGElementReference<TKnowledgeSource> reference, C context) { | ||
return null; | ||
} | ||
} |
91 changes: 0 additions & 91 deletions
91
dmn-core/src/main/java/com/gs/dmn/ast/SpecialVariableTransformerVisitor.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.