复制Bean对象属性<br>
限制类用于限制拷贝的属性，例如一个类我只想复制其父类的一些属性，就可以将editable设置为父类

@param source 源Bean对象
@param target 目标Bean对象
@param ignoreProperties 不拷贝的的属性列表
357755
public static void copyProperties(Object source, Object target, String... ignoreProperties) {
		copyProperties(source, target, CopyOptions.create().setIgnoreProperties(ignoreProperties));
	}
1260842
function copyOwnProperties(source, target, ignorePropertyNames = []) {
  Object.getOwnPropertyNames(source).forEach(name => {
    if (ignorePropertyNames.indexOf(name) < 0) {
      const descriptor = Object.getOwnPropertyDescriptor(source, name);
      Object.defineProperty(target, name, descriptor);
    }
  });
  return target;
}
31572
@SuppressWarnings({ "rawtypes", "unchecked" })
	private void beanToMap(Object bean, Map targetMap) {
		final Collection<PropDesc> props = BeanUtil.getBeanDesc(bean.getClass()).getProps();
		final HashSet<String> ignoreSet = (null != copyOptions.ignoreProperties) ? CollUtil.newHashSet(copyOptions.ignoreProperties) : null;
		final CopyOptions copyOptions = this.copyOptions;

		String key;
		Method getter;
		Object value;
		for (PropDesc prop : props) {
			key = prop.getFieldName();
			// 过滤class属性
			// 得到property对应的getter方法
			getter = prop.getGetter();
			if (null != getter) {
				// 只读取有getter方法的属性
				try {
					value = getter.invoke(bean);
				} catch (Exception e) {
					if (copyOptions.ignoreError) {
						continue;// 忽略反射失败
					} else {
						throw new UtilException(e, "Get value of [{}] error!", prop.getFieldName());
					}
				}
				if (CollUtil.contains(ignoreSet, key)) {
					// 目标属性值被忽略或值提供者无此key时跳过
					continue;
				}
				if (null == value && copyOptions.ignoreNullValue) {
					continue;// 当允许跳过空时，跳过
				}
				if (bean.equals(value)) {
					continue;// 值不能为bean本身，防止循环引用
				}
				targetMap.put(mappingKey(copyOptions.fieldMapping, key), value);
			}
		}
	}
548069
public static void mapping(Object src, Object target) throws BeanMappingException {
        BeanMapping mapping = BeanMapping.create(src.getClass(), target.getClass());
        mapping.mapping(src, target);
    }
58659
public void copyValuesFromTo(Collection<Object> source, List<Object> target) {
        target.addAll(source);
    }
555840
public function map($source, &$target)
    {
        $source = static::makeSource($source);
        $writer = static::makeWriter($target);

        foreach ($this->fields as $field) {
            try {
                $writer::set($target, $field->getName(), $field->getDefinition()->getValue($source));
            } catch (SourceFieldMissingException $e) {
                if ($this->ignoreAllMissing) {
                    continue;
                }
                throw $e;
            } catch (IgnoreFieldException $e) {
                continue;
            }
        }
    }
750126
public void unregisterPropertyExclusions( Class target ) {
      if( target != null ) {
         Set set = (Set) exclusionMap.get( target );
         if( set != null ) {
            set.clear();
         }
      }
   }
1324243
public void initialize(ControlBean bean, Object target)
    {
        initServices(bean, target);
        initControls(bean, target);
        initEventProxies(bean, target);
    }
498751
public void setEditorTarget (PropertyEditorTarget target)
    {
        if (target instanceof DBMetaCatalogNode)
        {
            super.setEditorTarget(target);
            this.tfCatalogName.setText((String)target.getAttribute(DBMetaCatalogNode.ATT_CATALOG_NAME));
        }
        else
        {
            throw new UnsupportedOperationException("This editor can only edit DBMetaCatalogNode objects");
        }
    }
1171178
@SuppressWarnings("rawtypes")
    private static Object getOneLayerClone(Object source) {
        if (null == source) {
            return null;
        }
        Object target = null;
        try {
            Constructor con = source.getClass().getConstructor();
            target = con.newInstance();
            // 把一个集合类中的数据拷贝到另一集合类中
            PropertyUtils.copyProperties(target, source);

        } catch (Exception e) {
            logger.error("clone object exception object class:" + source.getClass(), e);
        }
        return target;
    }
777246
@Override
   protected void implementInterface(InterfaceCapableSource<?> source, Iterable<String> value, JavaSourceFacet facet)
   {
      for (String type : value)
      {
         source.addInterface(type);
      }
   }
1090054
public static function copy($source, $target, $ignore = null)
    {
        $source = rtrim($source, '\\/');
        $target = rtrim($target, '\\/');

        if (!is_dir($source)) {
            throw new \RuntimeException('Cannot copy non-existing folder.');
        }

        // Make sure that path to the target exists before copying.
        self::create($target);

        $success = true;

        // Go through all sub-directories and copy everything.
        $files = self::all($source);
        foreach ($files as $file) {
            if ($ignore && preg_match($ignore, $file)) {
                continue;
            }
            $src = $source .'/'. $file;
            $dst = $target .'/'. $file;

            if (is_dir($src)) {
                // Create current directory (if it doesn't exist).
                if (!is_dir($dst)) {
                    $success &= @mkdir($dst, 0777, true);
                }
            } else {
                // Or copy current file.
                $success &= @copy($src, $dst);
            }
        }

        if (!$success) {
            $error = error_get_last();
            throw new \RuntimeException($error['message'] ?? 'Unknown error');
        }

        // Make sure that the change will be detected when caching.
        @touch(dirname($target));
    }
51754
public void load(Object source, Object target)
  {
    for (LoadField load : _loadFields) {
      load.load(source, target);
    }
  }
965517
public static void copyProperties(Object source, Object target, CopyOptions copyOptions) {
		if (null == copyOptions) {
			copyOptions = new CopyOptions();
		}
		BeanCopier.create(source, target, copyOptions).copy();
	}
364477
private T copyProperties(T source) {
        T target = createEmpty(source.getClass());

        Map<String, PropertyDescriptor> mapTargetProps = MappingUtils.mapPropertyDescriptors(target.getClass());
        Map<String, PropertyDescriptor> mapSourceProps = MappingUtils.mapPropertyDescriptors(source.getClass());

        Object value = null;

        for (String propertyName : mapSourceProps.keySet()) {
            value = MappingUtils.callGetter(source, mapSourceProps.get(propertyName));

            MappingUtils.callSetter(target, mapTargetProps.get(propertyName), value);
        }

        return target;
    }
1177183
void compileClass(Source javaSource, Source javaClass,
                    String sourcePath, boolean isMake)
    throws ClassNotFoundException
  {
    try {
      JavaCompilerUtil compiler = JavaCompilerUtil.create(getClassLoader());
      compiler.setClassDir(_classDir);
      compiler.setSourceDir(_sourceDir);
      if (_encoding != null)
        compiler.setEncoding(_encoding);
      compiler.setArgs(_args);
      compiler.setCompileParent(! isMake);
      compiler.setSourceExtension(_sourceExt);
      if (_compiler != null)
        compiler.setCompiler(_compiler);

      //LineMap lineMap = new LineMap(javaFile.getNativePath());
      // The context path is obvious from the browser url
      //lineMap.add(name.replace('.', '/') + _sourceExt, 1, 1);

      // Force this into a relative path so different compilers will work
      String prefix = _sourceDir.getPath();
      String full = javaSource.getPath();

      String source;
      if (full.startsWith(prefix)) {
        source = full.substring(prefix.length());
        if (source.startsWith("/"))
          source = source.substring(1);
      }
      else
        source = javaSource.getPath();

      /*
      if (javaSource.canRead() && javaClass.exists())
        javaClass.remove();
      */
          
      compiler.compileIfModified(source, null);
    } catch (Exception e) {
      //getClassLoader().addDependency(new Depend(javaSource));

      log.log(Level.FINEST, e.toString(), e);

      // Compile errors are wrapped in a special ClassNotFound class
      // so the server can give a nice error message
      throw new CompileClassNotFound(e);
    }
  }
657816
public static <T> T toBean(Object source, Class<T> clazz) {
		final T target = ReflectUtil.newInstance(clazz);
		copyProperties(source, target);
		return target;
	}