public void copyDeepInfoInto(OJMetaValue copy) { super.copyInfoInto(copy); copy.importType=importType; for (Object o : values) { if (o instanceof OJPathName) { copy.values.add(((OJPathName) o).getDeepCopy()); } else if (o instanceof OJAnnotationValue) { copy.values.add(((OJAnnotationValue) o).getDeepCopy()); // TODO ENumVAlue } else { copy.values.add(o); } } }
protected void copyDeepInfoInto(OJInterface copy) { super.copyDeepInfoInto(copy); Iterator superInterfacesIt = new ArrayList<OJPathName>(getSuperInterfaces()).iterator(); while ( superInterfacesIt.hasNext() ) { OJPathName elem = (OJPathName) superInterfacesIt.next(); copy.addToSuperInterfaces(elem.getDeepCopy()); } }
protected void copyDeepInfoInto(OJAnnotationValue result){ super.copyDeepInfoInto(result); result.type = type.getDeepCopy(); result.attributes = new TreeMap<String,OJAnnotationAttributeValue>(); for(OJAnnotationAttributeValue v:this.attributes.values()){ result.attributes.put(v.getName(), v.getDeepCopy()); } } public void renameAll(Set<OJPathName> renamePathNames,String newName){
protected void copyDeepInfoInto(OJAnnotatedInterface copy) { super.copyDeepInfoInto(copy); for (OJPathName superInterfaze : superInterfaces) { copy.addToSuperInterfaces(superInterfaze.getDeepCopy()); } }
public void copyDeepInto(OJAnnonymousInnerClass copy) { copy.classDeclaration = this.classDeclaration.getDeepCopy(copy.classDeclaration.getMyPackage()); copy.outer = this.outer.getDeepCopy(); super.copyDeepInfoInto(copy); } }
public OJPathName getDeepCopy() { OJPathName result = new OJPathName(); result.setNames(new ArrayList(this.getNames())); List<OJPathName> elementTypes = getElementTypes(); for (OJPathName elementType : elementTypes) { OJPathName elementTypeCopy = elementType.getDeepCopy(); if (elementType.getLast().contains("extends")) { System.out.println(); } result.addToElementTypes(elementTypeCopy); } return result; }
@Override public void renameAll(Set<OJPathName> renamePathNames, String suffix) { if (renamePathNames.contains(getPathName())) { this.suffix = suffix; } Set<OJPathName> newImports = new HashSet<OJPathName>(); Collection<OJPathName> imports = getImports(); for (OJPathName ojPathName : imports) { OJPathName newImport = ojPathName.getDeepCopy(); newImport.renameAll(renamePathNames, suffix); newImports.add(newImport); } setImports(newImports); Collection<OJOperation> operations = getOperations(); for (OJOperation ojOperation : operations) { ojOperation.renameAll(renamePathNames, suffix); } }
public void copyDeepInfoInto(OJParameter copy) { super.copyDeepInfoInto(copy); if (getType() != null) { copy.setType(getType().getDeepCopy()); copy.setFinal(isFinal); } }
public void copyDeepInfoInto(OJField copy) { super.copyDeepInfoInto(copy); copy.setInitExp(getInitExp()); if (getType() != null) { copy.setType(getType().getDeepCopy()); } }
@Override public void renameAll(Set<OJPathName> renamePathNames,String suffix){ super.renameAll(renamePathNames,suffix); Collection<OJConstructor> constructors = getConstructors(); for(OJConstructor ojConstructor:constructors){ ojConstructor.renameAll(renamePathNames, suffix); } // This is a jipo to make sure imports are correct. // renaming OJForStatement does not seem to add the renamed paths to the // imports Collection<OJPathName> newImports = new HashSet<OJPathName>(); Collection<OJPathName> imports = getImports(); for(OJPathName ojPathName:imports){ OJPathName newImport = ojPathName.getDeepCopy(); newImport.renameAll(renamePathNames, suffix); newImports.add(newImport); } addToImports(newImports); if(getSuperclass() != null){ getSuperclass().renameAll(renamePathNames, suffix); } Collection<OJPathName> implementedInterfaces = getImplementedInterfaces(); for(OJPathName ojPathName:implementedInterfaces){ ojPathName.renameAll(renamePathNames, suffix); } Collection<OJField> fields = getFields(); for(OJField ojField:fields){ ojField.renameAll(renamePathNames, suffix); } }
public void copyDeepInfoInto(OJForStatement copy) { super.copyDeepInfoInto(copy); copy.setElemName(getElemName()); copy.setCollection(getCollection()); if (getElemType() != null) { copy.setElemType(getElemType().getDeepCopy()); } if (getBody() != null) { copy.setBody(getBody().getDeepCopy()); } }
protected void copyDeepInfoInto(OJClass copy) { super.copyDeepInfoInto(copy); Collection<OJConstructor> constructors = getConstructors(); for (OJConstructor ojConstructor : constructors) { OJConstructor copyConstructor = ojConstructor.getDeepConstructorCopy(); copyConstructor.setReturnType(copy.getPathName()); copy.addToConstructors(copyConstructor); } if (getSuperclass()!=null) { OJPathName superClassCopy = getSuperclass().getDeepCopy(); copy.setSuperclass(superClassCopy); } Collection<OJField> fields = getFields(); for (OJField ojField : fields) { OJField ojFieldCopy = (OJField)ojField.getDeepCopy(); ojFieldCopy.setOwner(copy); copy.addToFields(ojFieldCopy); } }
protected void copyValuesDeep(OJOperation result){ result.setComment(getComment()); result.setBody(this.getBody().getDeepCopy()); result.setReturnType(this.getReturnType().getDeepCopy()); result.setFinal(this.isFinal()); result.setStatic(this.isStatic()); result.setVolatile(this.isVolatile()); result.setName(this.getName()); result.setAbstract(isAbstract()); for(OJParameter ojParameter:this.getParameters()){ result.addToParameters(ojParameter.getDeepCopy()); } result.setVisibility(this.getVisibility()); } protected void copyValues(OJOperation result){