Package com.alibaba.tamper.core.config

Examples of com.alibaba.tamper.core.config.BeanMappingFieldAttributes


        List<BeanMappingField> fields = new ArrayList<BeanMappingField>();
        BeanMappingBehavior globalBehavior = BeanMappingConfigHelper.getInstance().getGlobalBehavior();
        for (PropertyDescriptor targetPd : targetPds) {
            if (targetPd.getWriteMethod() != null && targetPd.getReadMethod() != null) {
                BeanMappingField field = new BeanMappingField();
                BeanMappingFieldAttributes srcFieldAttribute = new BeanMappingFieldAttributes();
                srcFieldAttribute.setName(targetPd.getName());
                srcFieldAttribute.setClazz(targetPd.getPropertyType());
                BeanMappingFieldAttributes targetFieldAttribute = new BeanMappingFieldAttributes();
                targetFieldAttribute.setName(targetPd.getName());
                targetFieldAttribute.setClazz(targetPd.getPropertyType());
                field.setSrcField(srcFieldAttribute);
                field.setTargetField(targetFieldAttribute);
                field.setBehavior(globalBehavior);// 设置为global
                fields.add(field);
            }
View Full Code Here


        newObject.setBehavior(object.getBehavior());
        List<BeanMappingField> fields = newObject.getBeanFields();
        for (BeanMappingField field : object.getBeanFields()) {
            // 倒转一下
            BeanMappingField newField = new BeanMappingField();
            BeanMappingFieldAttributes srcFieldAttribute = new BeanMappingFieldAttributes();
            srcFieldAttribute.setName(field.getTargetField().getName());
            srcFieldAttribute.setClazz(field.getTargetField().getClazz());
            BeanMappingFieldAttributes targetFieldAttribute = new BeanMappingFieldAttributes();
            targetFieldAttribute.setName(field.getSrcField().getName());
            targetFieldAttribute.setClazz(field.getSrcField().getClazz());

            newField.setSrcField(srcFieldAttribute);
            newField.setTargetField(targetFieldAttribute);
            newField.setDefaultValue(field.getDefaultValue());
            newField.setMapping(field.isMapping());
View Full Code Here

                continue;
            }

            if (targetPd.getWriteMethod() != null && srcPd.getReadMethod() != null) {
                BeanMappingField field = new BeanMappingField();
                BeanMappingFieldAttributes srcFieldAttribute = new BeanMappingFieldAttributes();
                srcFieldAttribute.setName(property);
                srcFieldAttribute.setClazz(srcPd.getPropertyType());
                BeanMappingFieldAttributes targetFieldAttribute = new BeanMappingFieldAttributes();
                targetFieldAttribute.setName(property);
                targetFieldAttribute.setClazz(targetPd.getPropertyType());
                // 添加记录
                field.setSrcField(srcFieldAttribute);
                field.setTargetField(targetFieldAttribute);
                field.setBehavior(globalBehavior);
                fields.add(field);
View Full Code Here

    public BeanMappingFieldAttributesBuilder(String name){
        this(name, null);
    }

    public BeanMappingFieldAttributesBuilder(String name, Class clazz){
        attributes = new BeanMappingFieldAttributes();
        attributes.setName(name);
        attributes.setClazz(clazz);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.tamper.core.config.BeanMappingFieldAttributes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.