热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.springframework.core.style.ToStringCreator.()方法的使用及代码示例

本文整理了Java中org.springframework.core.style.ToStringCreator.<init>()方法的一些代码示例,展示了

本文整理了Java中org.springframework.core.style.ToStringCreator.()方法的一些代码示例,展示了ToStringCreator.()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ToStringCreator.()方法的具体详情如下:
包路径:org.springframework.core.style.ToStringCreator
类名称:ToStringCreator
方法名:

ToStringCreator.介绍

[英]Create a ToStringCreator for the given object.
[中]为给定对象创建ToString Creator。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
* Provide a String representation of this bootstrap context's state.
*/
@Override
public String toString() {
return new ToStringCreator(this)//
.append("testClass", this.testClass.getName())//
.append("cacheAwareContextLoaderDelegate", this.cacheAwareContextLoaderDelegate.getClass().getName())//
.toString();
}

代码示例来源:origin: spring-projects/spring-framework

@Override
public String toString() {
return new ToStringCreator(this)//
.append("collaborator", this.collaborator)//
.toString();
}

代码示例来源:origin: spring-projects/spring-framework

@Override
public String toString() {
return new ToStringCreator(this).append("familyFavoriteSport", map).toString();
}
};

代码示例来源:origin: spring-projects/spring-framework

/**
* Provide a textual representation of this {@code AnnotationDescriptor}.
*/
@Override
public String toString() {
return new ToStringCreator(this)
.append("rootDeclaringClass", this.rootDeclaringClass)
.append("declaringClass", this.declaringClass)
.append("composedAnnotation", this.composedAnnotation)
.append("annotation", this.annotation)
.toString();
}
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void appendList() {
List list = new ArrayList<>();
list.add(s1);
list.add(s2);
list.add(s3);
String str = new ToStringCreator(this).append("myLetters", list).toString();
assertEquals("[ToStringCreatorTests@" + ObjectUtils.getIdentityHexString(this) + " myLetters = list[A, B, C]]",
str);
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void appendSet() {
Set set = new LinkedHashSet<>();
set.add(s1);
set.add(s2);
set.add(s3);
String str = new ToStringCreator(this).append("myLetters", set).toString();
assertEquals("[ToStringCreatorTests@" + ObjectUtils.getIdentityHexString(this) + " myLetters = set[A, B, C]]", str);
}

代码示例来源:origin: spring-projects/spring-framework

/**
* Provide a String representation of the {@code @TestPropertySource}
* attributes and declaring class.
*/
@Override
public String toString() {
return new ToStringCreator(this)//
.append("declaringClass", this.declaringClass.getName())//
.append("locations", ObjectUtils.nullSafeToString(this.locations))//
.append("inheritLocations", this.inheritLocations)//
.append("properties", ObjectUtils.nullSafeToString(this.properties))//
.append("inheritProperties", this.inheritProperties)//
.toString();
}

代码示例来源:origin: spring-projects/spring-framework

/**
* Print the supplied COOKIEs in a human-readable form, assuming the
* {@link COOKIE} implementation does not provide its own {@code toString()}.
* @since 4.2
*/
private void printCOOKIEs(COOKIE[] COOKIEs) {
String[] COOKIEStrings = new String[COOKIEs.length];
for (int i = 0; i COOKIE COOKIE = COOKIEs[i];
COOKIEStrings[i] = new ToStringCreator(COOKIE)
.append("name", COOKIE.getName())
.append("value", COOKIE.getValue())
.append("comment", COOKIE.getComment())
.append("domain", COOKIE.getDomain())
.append("maxAge", COOKIE.getMaxAge())
.append("path", COOKIE.getPath())
.append("secure", COOKIE.getSecure())
.append("version", COOKIE.getVersion())
.append("httpOnly", COOKIE.isHttpOnly())
.toString();
}
this.printer.printValue("COOKIEs", COOKIEStrings);
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void appendMethod() throws Exception {
String str = new ToStringCreator(this).append("myMethod", this.getClass().getMethod("appendMethod")).toString();
assertEquals("[ToStringCreatorTests@" + ObjectUtils.getIdentityHexString(this) +
" myMethod = appendMethod@ToStringCreatorTests]", str);
}

代码示例来源:origin: spring-projects/spring-framework

/**
* Provide a String representation of this test context's state.
*/
@Override
public String toString() {
return new ToStringCreator(this)
.append("testClass", this.testClass)
.append("testInstance", this.testInstance)
.append("testMethod", this.testMethod)
.append("testException", this.testException)
.append("mergedContextConfiguration", this.mergedContextConfiguration)
.append("attributes", this.attributes)
.toString();
}

代码示例来源:origin: spring-projects/spring-framework

/**
* Provide a String representation of the context configuration attributes
* and declaring class.
*/
@Override
public String toString() {
return new ToStringCreator(this)
.append("declaringClass", this.declaringClass.getName())
.append("classes", ObjectUtils.nullSafeToString(this.classes))
.append("locations", ObjectUtils.nullSafeToString(this.locations))
.append("inheritLocations", this.inheritLocations)
.append("initializers", ObjectUtils.nullSafeToString(this.initializers))
.append("inheritInitializers", this.inheritInitializers)
.append("name", this.name)
.append("contextLoaderClass", this.contextLoaderClass.getName())
.toString();
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void appendClass() {
String str = new ToStringCreator(this).append("myClass", this.getClass()).toString();
assertEquals("[ToStringCreatorTests@" + ObjectUtils.getIdentityHexString(this) +
" myClass = ToStringCreatorTests]", str);
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void primitiveArrays() {
int[] integers = new int[] {0, 1, 2, 3, 4};
String str = new ToStringCreator(integers).toString();
assertEquals("[@" + ObjectUtils.getIdentityHexString(integers) + " array[0, 1, 2, 3, 4]]", str);
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void defaultStyleArray() {
SomeObject[] array = new SomeObject[] {s1, s2, s3};
String str = new ToStringCreator(array).toString();
assertEquals("[@" + ObjectUtils.getIdentityHexString(array) +
" array[A, B, C]]", str);
}

代码示例来源:origin: spring-projects/spring-framework

/**
* Provide a String representation of the merged SQL script configuration.
*/
@Override
public String toString() {
return new ToStringCreator(this)
.append("dataSource", this.dataSource)
.append("transactionManager", this.transactionManager)
.append("transactionMode", this.transactionMode)
.append("encoding", this.encoding)
.append("separator", this.separator)
.append("commentPrefix", this.commentPrefix)
.append("blockCommentStartDelimiter", this.blockCommentStartDelimiter)
.append("blockCommentEndDelimiter", this.blockCommentEndDelimiter)
.append("errorMode", this.errorMode)
.toString();
}

代码示例来源:origin: spring-projects/spring-framework

/**
* Generate a text string containing the implementation type of this
* cache and its statistics.
*

The string returned by this method contains all information
* required for compliance with the contract for {@link #logStatistics()}.
* @return a string representation of this cache, including statistics
*/
@Override
public String toString() {
return new ToStringCreator(this)
.append("size", size())
.append("maxSize", getMaxSize())
.append("parentContextCount", getParentContextCount())
.append("hitCount", getHitCount())
.append("missCount", getMissCount())
.toString();
}

代码示例来源:origin: spring-projects/spring-framework

@Override
public String toString() {
// @formatter:off
return new ToStringCreator(this)
.append("id", this.getId())
.append("name", this.name)
.append("age", this.age)
.append("eyeColor", this.eyeColor)
.append("likesPets", this.likesPets)
.append("favoriteNumber", this.favoriteNumber)
.toString();
// @formatter:on
}

代码示例来源:origin: spring-projects/spring-petclinic

@Override
public String toString() {
return new ToStringCreator(this)
.append("id", this.getId()).append("new", this.isNew())
.append("lastName", this.getLastName())
.append("firstName", this.getFirstName()).append("address", this.address)
.append("city", this.city).append("telephone", this.telephone).toString();
}
}

代码示例来源:origin: spring-projects/spring-framework

/**
* Provide a String representation of the {@linkplain #getTestClass() test class},
* {@linkplain #getLocations() locations}, {@linkplain #getClasses() annotated classes},
* {@linkplain #getContextInitializerClasses() context initializer classes},
* {@linkplain #getActiveProfiles() active profiles},
* {@linkplain #getPropertySourceLocations() property source locations},
* {@linkplain #getPropertySourceProperties() property source properties},
* {@linkplain #getContextCustomizers() context customizers},
* the name of the {@link #getContextLoader() ContextLoader}, and the
* {@linkplain #getParent() parent configuration}.
*/
@Override
public String toString() {
return new ToStringCreator(this)
.append("testClass", this.testClass)
.append("locations", ObjectUtils.nullSafeToString(this.locations))
.append("classes", ObjectUtils.nullSafeToString(this.classes))
.append("contextInitializerClasses", ObjectUtils.nullSafeToString(this.contextInitializerClasses))
.append("activeProfiles", ObjectUtils.nullSafeToString(this.activeProfiles))
.append("propertySourceLocations", ObjectUtils.nullSafeToString(this.propertySourceLocations))
.append("propertySourceProperties", ObjectUtils.nullSafeToString(this.propertySourceProperties))
.append("contextCustomizers", this.contextCustomizers)
.append("contextLoader", nullSafeClassName(this.contextLoader))
.append("parent", this.parent)
.toString();
}

代码示例来源:origin: spring-projects/spring-framework

/**
* Provide a String representation of the {@linkplain #getTestClass() test class},
* {@linkplain #getLocations() locations}, {@linkplain #getClasses() annotated classes},
* {@linkplain #getContextInitializerClasses() context initializer classes},
* {@linkplain #getActiveProfiles() active profiles},
* {@linkplain #getPropertySourceLocations() property source locations},
* {@linkplain #getPropertySourceProperties() property source properties},
* {@linkplain #getContextCustomizers() context customizers},
* {@linkplain #getResourceBasePath() resource base path}, the name of the
* {@link #getContextLoader() ContextLoader}, and the
* {@linkplain #getParent() parent configuration}.
*/
@Override
public String toString() {
return new ToStringCreator(this)
.append("testClass", getTestClass())
.append("locations", ObjectUtils.nullSafeToString(getLocations()))
.append("classes", ObjectUtils.nullSafeToString(getClasses()))
.append("contextInitializerClasses", ObjectUtils.nullSafeToString(getContextInitializerClasses()))
.append("activeProfiles", ObjectUtils.nullSafeToString(getActiveProfiles()))
.append("propertySourceLocations", ObjectUtils.nullSafeToString(getPropertySourceLocations()))
.append("propertySourceProperties", ObjectUtils.nullSafeToString(getPropertySourceProperties()))
.append("contextCustomizers", getContextCustomizers())
.append("resourceBasePath", getResourceBasePath())
.append("contextLoader", nullSafeClassName(getContextLoader()))
.append("parent", getParent())
.toString();
}

推荐阅读
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 模板引擎StringTemplate的使用方法和特点
    本文介绍了模板引擎StringTemplate的使用方法和特点,包括强制Model和View的分离、Lazy-Evaluation、Recursive enable等。同时,还介绍了StringTemplate语法中的属性和普通字符的使用方法,并提供了向模板填充属性的示例代码。 ... [详细]
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • Spring源码解密之默认标签的解析方式分析
    本文分析了Spring源码解密中默认标签的解析方式。通过对命名空间的判断,区分默认命名空间和自定义命名空间,并采用不同的解析方式。其中,bean标签的解析最为复杂和重要。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • 本文讨论了在Spring 3.1中,数据源未能自动连接到@Configuration类的错误原因,并提供了解决方法。作者发现了错误的原因,并在代码中手动定义了PersistenceAnnotationBeanPostProcessor。作者删除了该定义后,问题得到解决。此外,作者还指出了默认的PersistenceAnnotationBeanPostProcessor的注册方式,并提供了自定义该bean定义的方法。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • 在重复造轮子的情况下用ProxyServlet反向代理来减少工作量
    像不少公司内部不同团队都会自己研发自己工具产品,当各个产品逐渐成熟,到达了一定的发展瓶颈,同时每个产品都有着自己的入口,用户 ... [详细]
  • FeatureRequestIsyourfeaturerequestrelatedtoaproblem?Please ... [详细]
  • 标题: ... [详细]
  • 利用Visual Basic开发SAP接口程序初探的方法与原理
    本文介绍了利用Visual Basic开发SAP接口程序的方法与原理,以及SAP R/3系统的特点和二次开发平台ABAP的使用。通过程序接口自动读取SAP R/3的数据表或视图,在外部进行处理和利用水晶报表等工具生成符合中国人习惯的报表样式。具体介绍了RFC调用的原理和模型,并强调本文主要不讨论SAP R/3函数的开发,而是针对使用SAP的公司的非ABAP开发人员提供了初步的接口程序开发指导。 ... [详细]
author-avatar
馨海之洋_895
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有