private Collection<ComponentParameter> synchronizeComponentParameters( Collection<ComponentParameter> componentParametersToSynchronize, Component parentComponent ) { List<ComponentParameter> componentParameters = new ArrayList<ComponentParameter>(componentParametersToSynchronize.size()); for ( ComponentParameter componentParameter : componentParametersToSynchronize ) { if (componentParameter.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().isTransient(componentParameter)) { componentParameter = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().getByAc(componentParameter.getAc()); } componentParameter.setCvParameterType( synchronize (componentParameter.getCvParameterType())); componentParameter.setCvParameterUnit( synchronize (componentParameter.getCvParameterUnit())); componentParameter.setComponent(parentComponent); componentParameters.add(componentParameter); } return componentParameters; }
private Collection<ComponentParameter> synchronizeComponentParameters( Collection<ComponentParameter> componentParametersToSynchronize, Component parentComponent ) { List<ComponentParameter> componentParameters = new ArrayList<ComponentParameter>(componentParametersToSynchronize.size()); for ( ComponentParameter componentParameter : componentParametersToSynchronize ) { if (componentParameter.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().isTransient(componentParameter)) { componentParameter = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentParameterDao().getByAc(componentParameter.getAc()); } componentParameter.setCvParameterType( synchronize (componentParameter.getCvParameterType())); componentParameter.setCvParameterUnit( synchronize (componentParameter.getCvParameterUnit())); componentParameter.setComponent(parentComponent); componentParameters.add(componentParameter); } return componentParameters; }
protected ComponentParameter cloneComponentParameter(ComponentParameter componentParameter) throws IntactClonerException { if (componentParameter == null) { throw new IllegalArgumentException("You must give a non null component parameter"); } ComponentParameter clone = new ComponentParameter(); clonerManager.addClone(componentParameter, clone); clone.setBase(componentParameter.getBase()); clone.setExponent(componentParameter.getExponent()); clone.setFactor(componentParameter.getFactor()); clone.setUncertainty(componentParameter.getUncertainty()); clone.setCvParameterType(clone(componentParameter.getCvParameterType())); clone.setCvParameterUnit(clone(componentParameter.getCvParameterUnit())); clone.setComponent(componentParameter.getComponent()); return clone; }
protected ComponentParameter cloneComponentParameter(ComponentParameter componentParameter) throws IntactClonerException { if (componentParameter == null) { throw new IllegalArgumentException("You must give a non null component parameter"); } ComponentParameter clone = new ComponentParameter(); clonerManager.addClone(componentParameter, clone); clone.setBase(componentParameter.getBase()); clone.setExponent(componentParameter.getExponent()); clone.setFactor(componentParameter.getFactor()); clone.setUncertainty(componentParameter.getUncertainty()); clone.setCvParameterType(clone(componentParameter.getCvParameterType())); clone.setCvParameterUnit(clone(componentParameter.getCvParameterUnit())); clone.setComponent(componentParameter.getComponent()); return clone; }