當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。