@Component(role=InheritanceAssembler.class) public class DefaultInheritanceAssembler extends java.lang.Object implements InheritanceAssembler
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultInheritanceAssembler.InheritanceModelMerger
InheritanceModelMerger
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CHILD_DIRECTORY |
private static java.lang.String |
CHILD_DIRECTORY_PROPERTY |
private DefaultInheritanceAssembler.InheritanceModelMerger |
merger |
Constructor and Description |
---|
DefaultInheritanceAssembler() |
Modifier and Type | Method and Description |
---|---|
void |
assembleModelInheritance(Model child,
Model parent,
ModelBuildingRequest request,
ModelProblemCollector problems)
Merges values from the specified parent model into the given child model.
|
private java.lang.String |
getChildPathAdjustment(Model child,
Model parent,
java.lang.String childDirectory)
Calculates the relative path from the base directory of the parent to the parent directory of the base directory
of the child.
|
private DefaultInheritanceAssembler.InheritanceModelMerger merger
private static final java.lang.String CHILD_DIRECTORY
private static final java.lang.String CHILD_DIRECTORY_PROPERTY
public void assembleModelInheritance(Model child, Model parent, ModelBuildingRequest request, ModelProblemCollector problems)
InheritanceAssembler
assembleModelInheritance
in interface InheritanceAssembler
child
- The child model into which to merge the values inherited from the parent, must not be
null
.parent
- The (read-only) parent model from which to inherit the values, may be null
.request
- The model building request that holds further settings, must not be null
.problems
- The container used to collect problems that were encountered, must not be null
.private java.lang.String getChildPathAdjustment(Model child, Model parent, java.lang.String childDirectory)
This calculation is only a heuristic based on our conventions. In detail, the algo relies on the following assumptions:
child
- The child model, must not be null
.parent
- The parent model, may be null
.childDirectory
- The directory defined in child model, may be null
.null
.