Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updaded Axiom model & Prism model based on discussion
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
- Loading branch information
1 parent
752f231
commit a3aa1c1
Showing
5 changed files
with
49 additions
and
13 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
infra/axiom/src/main/java/com/evolveum/axiom/api/meta/Inheritance.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,35 @@ | ||
package com.evolveum.axiom.api.meta; | ||
|
||
import com.evolveum.axiom.api.AxiomIdentifier; | ||
import com.evolveum.axiom.lang.api.AxiomItemDefinition; | ||
|
||
public interface Inheritance { | ||
|
||
Inheritance INHERIT = Inheritance::inheritNamespace; | ||
Inheritance NO_CHANGE = Inheritance::noChange; | ||
Inheritance NO_NAMESPACE = Inheritance::noNamespace; | ||
Inheritance CURRENT = NO_CHANGE; | ||
|
||
|
||
static AxiomIdentifier adapt(AxiomIdentifier parent, AxiomIdentifier child) { | ||
return CURRENT.apply(parent, child); | ||
} | ||
|
||
static AxiomIdentifier adapt(AxiomIdentifier parent, AxiomItemDefinition child) { | ||
return child.inherited() ? adapt(parent, child.name()) : child.name(); | ||
} | ||
|
||
AxiomIdentifier apply(AxiomIdentifier parent, AxiomIdentifier child); | ||
|
||
static AxiomIdentifier inheritNamespace(AxiomIdentifier parent, AxiomIdentifier name) { | ||
return parent.localName(name.localName()); | ||
} | ||
|
||
static AxiomIdentifier noNamespace(AxiomIdentifier parent, AxiomIdentifier name) { | ||
return name.defaultNamespace(); | ||
} | ||
|
||
static AxiomIdentifier noChange(AxiomIdentifier parent, AxiomIdentifier name) { | ||
return name; | ||
} | ||
} |
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