本文整理汇总了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;
}
示例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();
}
示例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();
}
}
示例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();
}
示例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;
}
示例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();
}
示例7: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
示例8: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this,
ToStringStyle.SIMPLE_STYLE, true, true);
}
示例9: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
public String toString(){
return ReflectionToStringBuilder.toString(this);
}
示例10: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
return (ReflectionToStringBuilder.toString(this));
}
示例11: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
示例12: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
public String toString() {
return(ReflectionToStringBuilder.toString(this));
}
示例13: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
示例14: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
示例15: toString
import org.apache.commons.lang.builder.ReflectionToStringBuilder; //导入方法依赖的package包/类
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);
}