示例#1
0
 public <T> T createParameters(Class<T> cls, T copyFrom) {
   T t = createParameters(cls);
   if (t != null) {
     ((Tuples._3) t).assign((Tuples._3) copyFrom);
   }
   return t;
 }
示例#2
0
 @Override
 protected SNode createObject(Attributes attrs) throws SAXException {
   Tuples._3<ConceptKind, StaticScope, Boolean> parsed =
       fieldhelper.readNodeInfo(attrs.getValue("nodeInfo"));
   if (parsed == null) {
     throw new SAXParseException("bad typeInfo attribute", null);
   }
   boolean interfaceNode = false;
   if (fieldinterfaceOnly) {
     if (fieldhasRefactorings == null) {
       fieldhasRefactorings = StructureModificationProcessor.hasRefactoringsToPlay(fieldmodel);
     }
     if (!(fieldhasRefactorings)) {
       interfaceNode = (parsed._0() == ConceptKind.INTERFACE || attrs.getValue("role") == null);
     }
   }
   jetbrains.mps.smodel.SNode result =
       (interfaceNode
           ? new InterfaceSNode(fieldhelper.readType(attrs.getValue("type")))
           : new jetbrains.mps.smodel.SNode(fieldhelper.readType(attrs.getValue("type"))));
   fieldlinkMap.addNodeMetainfo(parsed._0(), parsed._1(), (boolean) parsed._2(), result);
   return result;
 }