当前位置: 首页>>代码示例>>Java>>正文


Java ReflectionToStringBuilder.toString方法代码示例

本文整理汇总了Java中org.apache.commons.lang.builder.ReflectionToStringBuilder.toString方法的典型用法代码示例。如果您正苦于以下问题:Java ReflectionToStringBuilder.toString方法的具体用法?Java ReflectionToStringBuilder.toString怎么用?Java ReflectionToStringBuilder.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang.builder.ReflectionToStringBuilder的用法示例。


在下文中一共展示了ReflectionToStringBuilder.toString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doConnect

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
protected Connection doConnect(final ISupplierWithException<Connection, SQLException> supplier) throws DatabaseAnonymizerException {
    final Field[] allFields = supplier.getClass().getDeclaredFields();
    assertEquals(1, allFields.length);
    final Field field = allFields[0];
    field.setAccessible(true);
    try { // not exactly a great test, but checks that supplier has parent's properties at least
        final String representation = ReflectionToStringBuilder.toString(field.get(supplier));
        log.debug(representation);
        assertTrue(representation.contains(
            "[driver=java.util.List,vendor=mssql,url=invalid-url,userName=invalid-user,password=invalid-pass]"));
    } catch (IllegalArgumentException | IllegalAccessException e) {
        log.error(e.toString());
    }
    return mockConnection;
}
 
开发者ID:armenak,项目名称:DataDefender,代码行数:17,代码来源:MSSQLDBConnectionTest.java

示例2: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
    class VendorHeaderToStringBuilder extends ReflectionToStringBuilder {
        private VendorHeaderToStringBuilder(Object object) {
            super(object);
        }

        @Override
        public boolean accept(Field field) {
            if (BusinessObject.class.isAssignableFrom(field.getType())) {
                return false;
            }

            DataDictionaryService dataDictionaryService = SpringContext.getBean(DataDictionaryService.class);
            AttributeSecurity attributeSecurity = dataDictionaryService.getAttributeSecurity(VendorHeader.class.getName(), field.getName());
            if (ObjectUtils.isNotNull(attributeSecurity)
                            && (attributeSecurity.isHide() || attributeSecurity.isMask() || attributeSecurity.isPartialMask())) {
                return false;
            }

            return super.accept(field);
        }
    };
    ReflectionToStringBuilder toStringBuilder = new VendorHeaderToStringBuilder(this);
    return toStringBuilder.toString();
}
 
开发者ID:kuali,项目名称:kfs,代码行数:27,代码来源:VendorHeader.java

示例3: find

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public Rule find(RuleQuery query) {
  Collection<Rule> all = findAll(query);
  if (all.size() > 1) {
    throw new IllegalArgumentException("Non unique result for rule query: " + ReflectionToStringBuilder.toString(query, ToStringStyle.SHORT_PREFIX_STYLE));
  } else if (all.isEmpty()) {
    return null;
  } else {
    return all.iterator().next();
  }
}
 
开发者ID:instalint-org,项目名称:instalint,代码行数:12,代码来源:RuleFinderCompatibility.java

示例4: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
    
    ReflectionToStringBuilder tsb = 
        new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
    return tsb.toString();
}
 
开发者ID:mikkeliamk,项目名称:osa,代码行数:8,代码来源:DatabaseConfiguration.java

示例5: doConnect

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
protected Connection doConnect(final ISupplierWithException<Connection, SQLException> supplier) throws DatabaseAnonymizerException {
    final Field[] allFields = supplier.getClass().getDeclaredFields();
    assertEquals(1, allFields.length);
    final Field field = allFields[0];
    field.setAccessible(true);
    try { // not exactly a great test, but checks that supplier has parent's properties at least
        final String representation = ReflectionToStringBuilder.toString(field.get(supplier));
        assertTrue(representation.contains(
            "[driver=java.util.List,vendor=mysql,url=invalid-url,userName=invalid-user,password=invalid-pass]"));
    } catch (IllegalArgumentException | IllegalAccessException e) {
        log.error(e.toString());
    }
    return mockConnection;
}
 
开发者ID:armenak,项目名称:DataDefender,代码行数:16,代码来源:MySQLDBConnectionTest.java

示例6: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
/**
 * KFSCNTRB-1682: Some of the fields contain confidential information
 * @see org.kuali.rice.krad.bo.BusinessObjectBase#toString()
 */
@Override
public String toString() {
    class PayeeACHAccountToStringBuilder extends ReflectionToStringBuilder {
        private PayeeACHAccountToStringBuilder(Object object) {
            super(object);
        }

        @Override
        public boolean accept(Field field) {
            if (BusinessObject.class.isAssignableFrom(field.getType())) {
                return false;
            }

            DataDictionaryService dataDictionaryService = SpringContext.getBean(DataDictionaryService.class);
            AttributeSecurity attributeSecurity = dataDictionaryService.getAttributeSecurity(PayeeACHAccount.class.getName(), field.getName());
            if ((ObjectUtils.isNotNull(attributeSecurity)
                    && (attributeSecurity.isHide() || attributeSecurity.isMask() || attributeSecurity.isPartialMask()))) {
                return false;
            }

            return super.accept(field);
        }
    };
    ReflectionToStringBuilder toStringBuilder = new PayeeACHAccountToStringBuilder(this);
    return toStringBuilder.toString();
}
 
开发者ID:kuali,项目名称:kfs,代码行数:31,代码来源:PayeeACHAccount.java

示例7: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
    return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
 
开发者ID:baidu,项目名称:uid-generator,代码行数:5,代码来源:WorkerNodeEntity.java

示例8: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
	return ReflectionToStringBuilder.toString(this, 
			ToStringStyle.SIMPLE_STYLE, true, true);
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:6,代码来源:ActivatedSwitchEvent.java

示例9: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
public String toString(){
	return ReflectionToStringBuilder.toString(this);
}
 
开发者ID:jambo-framework,项目名称:jambo2,代码行数:4,代码来源:DBAccessUser.java

示例10: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
	return (ReflectionToStringBuilder.toString(this));
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:5,代码来源:MeasurementMapTransfer.java

示例11: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
public String toString() {
  return ReflectionToStringBuilder.toString(this);
}
 
开发者ID:saptarshidebnath,项目名称:processrunner,代码行数:4,代码来源:ProcessConfigurationException.java

示例12: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
public String toString() {
	return(ReflectionToStringBuilder.toString(this));
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:4,代码来源:OcanDomainConsumerStaffBean.java

示例13: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
public String toString() {
    return ReflectionToStringBuilder.toString(this);
}
 
开发者ID:MakeITBologna,项目名称:zefiro,代码行数:4,代码来源:RelationBean.java

示例14: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
   return ReflectionToStringBuilder.toString(this);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:5,代码来源:IndicatorPanelBean.java

示例15: toString

import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
 public String toString() {
    return ReflectionToStringBuilder.toString(this);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:5,代码来源:WCBCodes.java


注:本文中的org.apache.commons.lang.builder.ReflectionToStringBuilder.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。