public PropertySubstituteAction(SNode sourceNode, String propertyName, String propertyValue) {
   super(null, null, sourceNode);
   SNode propertyDeclaration = sourceNode.getPropertyDeclaration(propertyName);
   myPropertySupport = PropertySupport.getPropertySupport(propertyDeclaration);
   myPropertyName = propertyName;
   myPropertyValue = propertyValue;
 }
示例#2
0
 public ModelLinkMap build() {
   // build map based on already loaded model
   for (SNode node : myModel.nodes()) {
     addRoleLocation(ptr(node.getRoleLink()), node);
     addTypeLocation(ptr(SNodeOperations.getConceptDeclaration(node)), node);
     for (String prop : SetSequence.fromSet(node.getPropertyNames())) {
       addNameLocation(ptr(node.getPropertyDeclaration(prop)), node, prop);
     }
     for (SReference ref : Sequence.fromIterable(SNodeOperations.getReferences(node))) {
       addRoleLocation(ptr(SLinkOperations.findLinkDeclaration(ref)), ref);
       if ((SReference) ref instanceof StaticReference) {
         addTargetLocation(
             ptr(SLinkOperations.getTargetNode(ref)), (StaticReference) (SReference) ref);
       } else {
         addDynamicReference(ref.getTargetSModelReference(), (DynamicReference) (SReference) ref);
       }
     }
   }
   return this;
 }