public class Aai20IReferenceManipulationStrategy extends AbstractReferenceLocalizationStrategy implements IReferenceManipulationStrategy
IReferenceManipulationStrategy.ReferenceAndNode
PREFIX
Constructor and Description |
---|
Aai20IReferenceManipulationStrategy() |
Modifier and Type | Method and Description |
---|---|
IReferenceManipulationStrategy.ReferenceAndNode |
attachAsDefinition(Document document,
String name,
Node component)
Add the node to the document (wrapped) as a component/definition.
|
Map<String,Node> |
getExistingLocalComponents(Document document)
Get a collection of local components/definitions, mapped by their local reference string.
|
transform, wrap
public IReferenceManipulationStrategy.ReferenceAndNode attachAsDefinition(Document document, String name, Node component)
IReferenceManipulationStrategy
Given a node, if it can be represented as a IDefinition
,
it's wrapped into one and attached to the appropriate place in the document.
This new definition node is returned (the original itself is not attached), together with a canonical reference to the new definition.
The reference is generated from the provided name. If a definition with the provided name
already exists, throw an IllegalArgumentException
.
attachAsDefinition
in interface IReferenceManipulationStrategy
document
- Target model to manipulatename
- Suggested definition namecomponent
- Node to be attached as a definitionpublic Map<String,Node> getExistingLocalComponents(Document document)
IReferenceManipulationStrategy
getExistingLocalComponents
in interface IReferenceManipulationStrategy
Copyright © 2020 Red Hat. All rights reserved.