public List<com.sap.psr.vulas.shared.json.model.ConstructId> getSharedConstructs() throws FileAnalysisException { List<com.sap.psr.vulas.shared.json.model.ConstructId> l= new ArrayList<com.sap.psr.vulas.shared.json.model.ConstructId>(); for(ConstructId c: this.getConstructs().keySet()) { l.add(new com.sap.psr.vulas.shared.json.model.ConstructId(ProgrammingLanguage.PY, c.getSharedType(),c.getQualifiedName())); } return l; } }
public List<com.sap.psr.vulas.shared.json.model.ConstructId> getSharedConstructs() throws FileAnalysisException { List<com.sap.psr.vulas.shared.json.model.ConstructId> l= new ArrayList<com.sap.psr.vulas.shared.json.model.ConstructId>(); for(ConstructId c: this.getConstructIds()) { l.add(new com.sap.psr.vulas.shared.json.model.ConstructId(ProgrammingLanguage.JAVA, c.getSharedType(),c.getQualifiedName())); } return l; }
/** * Transforms an object with a given core type (defined in vulas-core) into * an object having the corresponding shared type (defined in vulas-share). * @param _core_type * @return */ public static com.sap.psr.vulas.shared.json.model.ConstructId toSharedType(com.sap.psr.vulas.ConstructId _core_type) { return new com.sap.psr.vulas.shared.json.model.ConstructId(_core_type.getLanguage(), _core_type.getSharedType(), _core_type.getQualifiedName()); }
public void visitPackageDifferences(PackageDifferences differences) { if (differences.isRemoved()) { jarDiffResult.addDeletedPackage(new com.sap.psr.vulas.shared.json.model.ConstructId(ProgrammingLanguage.JAVA, ConstructType.PACK, differences.getName())); } for (Differences classDiffenrence : differences.getClassDifferences()) { classDiffenrence.accept(this); } if (differences.isNew()) { jarDiffResult.addNewPackage(new com.sap.psr.vulas.shared.json.model.ConstructId(ProgrammingLanguage.JAVA, ConstructType.PACK, differences.getName())); } }
throw new IllegalArgumentException("Cannot determine . in qname [" + _cid.getQname() + "]"); else ccid = new ConstructId(_cid.getLang(), ConstructType.CLAS, _cid.getQname().substring(0, idx)); throw new IllegalArgumentException("Cannot determine . in qname [" + _cid.getQname() + "]"); else ccid = new ConstructId(_cid.getLang(), ConstructType.CLAS, _cid.getQname().substring(0, idx));
private com.sap.psr.vulas.shared.json.model.ConstructId getClass(Classfile _classfile) { com.sap.psr.vulas.shared.json.model.ConstructId c = new com.sap.psr.vulas.shared.json.model.ConstructId(); c.addRelates("annotation", new ConstructId(ProgrammingLanguage.JAVA, ConstructType.INTF, "java.lang.Deprecated")); Iterator<? extends Class_info> i = _classfile.getAllInterfaces().iterator(); while (i.hasNext()) { c.addRelates("extends", new ConstructId(ProgrammingLanguage.JAVA, ConstructType.INTF, i.next().toString())); c.addRelates("extends", new ConstructId(ProgrammingLanguage.JAVA, ConstructType.CLAS, _classfile.getSuperclassName())); c.addAttribute("abstract", _classfile.isAbstract()); Iterator<? extends Class_info> i = _classfile.getAllInterfaces().iterator(); while (i.hasNext()) { c.addRelates("implements", new ConstructId(ProgrammingLanguage.JAVA, ConstructType.INTF,i.next().toString()));
com.sap.psr.vulas.shared.json.model.ConstructId pid = new com.sap.psr.vulas.shared.json.model.ConstructId(ProgrammingLanguage.PY,PythonId.toSharedType(PythonId.typeFromString(type)), qname);
public com.sap.psr.vulas.shared.json.model.ConstructId toSharedType() { final com.sap.psr.vulas.shared.json.model.ConstructId shared_type = new com.sap.psr.vulas.shared.json.model.ConstructId(); shared_type.setLang(this.getLang()); shared_type.setType(this.getType()); shared_type.setQname(this.getQname()); return shared_type; } }
private com.sap.psr.vulas.shared.json.model.ConstructId getMethod(Method_info _mi) { com.sap.psr.vulas.shared.json.model.ConstructId m = new com.sap.psr.vulas.shared.json.model.ConstructId(); m.addRelates("annotation", new ConstructId(ProgrammingLanguage.JAVA, ConstructType.INTF, "java.lang.Deprecated")); m.setType(ConstructType.METH); m.addRelates("returns", new ConstructId(ProgrammingLanguage.JAVA, ConstructType.CLAS, _mi.getReturnType())); while (i.hasNext()) { m.addRelates("throws", new ConstructId(ProgrammingLanguage.JAVA, ConstructType.CLAS, i.next().toString()));
/** * Returns a {@link ConstructId} of type {@link ConstructType#PACK} in which the given construct ID has been declared. * @param _cid * @return */ public static ConstructId getPackageOf(ConstructId _cid) { ConstructId ccid = null; if(_cid.getType()==ConstructType.PACK) ccid = _cid; else if(_cid.getType()==ConstructType.CLAS) { int idx = _cid.getQname().lastIndexOf("."); //final String ctx = _cid.getQname().substring(0, idx); if(idx==-1) ccid = null; //throw new IllegalArgumentException("Cannot determine . in qname [" + _cid.getQname() + "]"); else ccid = new ConstructId(_cid.getLang(), ConstructType.PACK, _cid.getQname().substring(0, idx)); } else if(_cid.getType()==ConstructType.INIT || _cid.getType()==ConstructType.METH) ccid = JarDiffResult.getPackageOf(JarDiffResult.getClassOf(_cid)); else if(_cid.getType()==ConstructType.CONS) ccid = JarDiffResult.getPackageOf(JarDiffResult.getClassOf(_cid)); return ccid; }