Here are the examples of the java api org.springframework.util.ClassUtils.getShortName() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
56 Examples
19
Source : SpringBootCondition.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
private StringBuilder getLogMessage(String clreplacedOrMethodName, ConditionOutcome outcome) {
StringBuilder message = new StringBuilder();
message.append("Condition ");
message.append(ClreplacedUtils.getShortName(getClreplaced()));
message.append(" on ");
message.append(clreplacedOrMethodName);
message.append(outcome.isMatch() ? " matched" : " did not match");
if (StringUtils.hasLength(outcome.getMessage())) {
message.append(" due to ");
message.append(outcome.getMessage());
}
return message;
}
19
Source : DefaultValueStyler.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
private String styleArray(Object[] array) {
StringBuilder result = new StringBuilder(array.length * 8 + 16);
result.append(ARRAY + "<").append(ClreplacedUtils.getShortName(array.getClreplaced().getComponentType())).append(">[");
for (int i = 0; i < array.length - 1; i++) {
result.append(style(array[i]));
result.append(',').append(' ');
}
if (array.length > 0) {
result.append(style(array[array.length - 1]));
} else {
result.append(EMPTY);
}
result.append("]");
return result.toString();
}
19
Source : IdToEntityConverter.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
private String getEnreplacedyName(Clreplaced<?> enreplacedyClreplaced) {
String shortName = ClreplacedUtils.getShortName(enreplacedyClreplaced);
int lastDot = shortName.lastIndexOf('.');
if (lastDot != -1) {
return shortName.substring(lastDot + 1);
} else {
return shortName;
}
}
19
Source : RemoteExporter.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
/**
* Return a short name for this exporter.
* Used for tracing of remote invocations.
* <p>Default is the unqualified clreplaced name (without package).
* Can be overridden in subclreplacedes.
* @see #getProxyForService
* @see RemoteInvocationTraceInterceptor
* @see org.springframework.util.ClreplacedUtils#getShortName
*/
protected String getExporterName() {
return ClreplacedUtils.getShortName(getClreplaced());
}
19
Source : ConfigurationClass.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
public String getSimpleName() {
return ClreplacedUtils.getShortName(getMetadata().getClreplacedName());
}
19
Source : AbstractTaskCommand.java
with Apache License 2.0
from redis-developer
with Apache License 2.0
from redis-developer
private Job job() throws Exception {
return jobFactory.job(ClreplacedUtils.getShortName(getClreplaced())).start(flow()).build().build();
}
19
Source : FormatableJavaClass.java
with Apache License 2.0
from odrotbohm
with Apache License 2.0
from odrotbohm
public String getAbbreviatedFullName(@Nullable Module module) {
if (module == null) {
return getAbbreviatedFullName();
}
String basePackageName = module.getBasePackage().getName();
if (!StringUtils.hasText(basePackageName)) {
return getAbbreviatedFullName();
}
String typePackageName = type.getPackageName();
if (basePackageName.equals(typePackageName)) {
return getAbbreviatedFullName();
}
if (!typePackageName.startsWith(basePackageName)) {
return getFullName();
}
return //
abbreviate(basePackageName).concat(//
typePackageName.substring(basePackageName.length())).concat(//
".").concat(ClreplacedUtils.getShortName(getFullName()));
}
19
Source : NamingThreadFactory.java
with Apache License 2.0
from linhuaichuan
with Apache License 2.0
from linhuaichuan
/**
* Get the method invoker's clreplaced name
*
* @param depth
* @return
*/
private String getInvoker(int depth) {
Exception e = new Exception();
StackTraceElement[] stes = e.getStackTrace();
if (stes.length > depth) {
return ClreplacedUtils.getShortName(stes[depth].getClreplacedName());
}
return getClreplaced().getSimpleName();
}
19
Source : SolrClientUtils.java
with Apache License 2.0
from learningtcc
with Apache License 2.0
from learningtcc
private static String getSolrClientTypeName(SolrClient solrClient) {
Clreplaced<?> solrClientType = ClreplacedUtils.isCglibProxy(solrClient) ? ClreplacedUtils.getUserClreplaced(solrClient) : solrClient.getClreplaced();
String shortName = ClreplacedUtils.getShortName(solrClientType);
return shortName;
}
19
Source : MulticoreSolrClientFactory.java
with Apache License 2.0
from learningtcc
with Apache License 2.0
from learningtcc
/**
* Get the clreplaced short name. Strips the outer clreplaced name in case of an inner
* clreplaced.
*
* @param clazz
* @see org.springframework.util.ClreplacedUtils#getShortName(Clreplaced)
* @return
*/
protected static String getShortClreplacedName(Clreplaced<?> clazz) {
String shortName = ClreplacedUtils.getShortName(clazz);
int dotIndex = shortName.lastIndexOf('.');
return (dotIndex != -1 ? shortName.substring(dotIndex + 1) : shortName);
}
19
Source : ControllerClassNameHandlerMapping.java
with Apache License 2.0
from langtianya
with Apache License 2.0
from langtianya
/**
* Generate the actual URL paths for the given controller clreplaced.
* <p>Subclreplacedes may choose to customize the paths that are generated
* by overriding this method.
* @param beanClreplaced the controller bean clreplaced to generate a mapping for
* @return the URL path mappings for the given controller
*/
protected String[] generatePathMappings(Clreplaced<?> beanClreplaced) {
StringBuilder pathMapping = buildPathPrefix(beanClreplaced);
String clreplacedName = ClreplacedUtils.getShortName(beanClreplaced);
String path = (clreplacedName.endsWith(CONTROLLER_SUFFIX) ? clreplacedName.substring(0, clreplacedName.lastIndexOf(CONTROLLER_SUFFIX)) : clreplacedName);
if (path.length() > 0) {
if (this.caseSensitive) {
pathMapping.append(path.substring(0, 1).toLowerCase()).append(path.substring(1));
} else {
pathMapping.append(path.toLowerCase());
}
}
if (isMultiActionControllerType(beanClreplaced)) {
return new String[] { pathMapping.toString(), pathMapping.toString() + "/*" };
} else {
return new String[] { pathMapping.toString() + "*" };
}
}
18
Source : ImportAutoConfigurationTests.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
private List<String> getImportedConfigBeans(Clreplaced<?>... config) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(config);
String shortName = ClreplacedUtils.getShortName(ImportAutoConfigurationTests.clreplaced);
int beginIndex = shortName.length() + 1;
List<String> orderedConfigBeans = new ArrayList<>();
for (String bean : context.getBeanDefinitionNames()) {
if (bean.contains("$Config")) {
String shortBeanName = ClreplacedUtils.getShortName(bean);
orderedConfigBeans.add(shortBeanName.substring(beginIndex));
}
}
context.close();
return orderedConfigBeans;
}
18
Source : ConditionEvaluationReportMessage.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
private MultiValueMap<String, String> mapToFullyQualifiedNames(Set<String> keySet) {
LinkedMultiValueMap<String, String> map = new LinkedMultiValueMap<>();
keySet.forEach((fullyQualifiedName) -> map.add(ClreplacedUtils.getShortName(fullyQualifiedName), fullyQualifiedName));
return map;
}
18
Source : ConditionEvaluationReportMessage.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
private void logConditionAndOutcome(StringBuilder message, String indent, ConditionAndOutcome conditionAndOutcome) {
message.append(String.format("%s- ", indent));
String outcomeMessage = conditionAndOutcome.getOutcome().getMessage();
if (StringUtils.hasLength(outcomeMessage)) {
message.append(outcomeMessage);
} else {
message.append(conditionAndOutcome.getOutcome().isMatch() ? "matched" : "did not match");
}
message.append(" (");
message.append(ClreplacedUtils.getShortName(conditionAndOutcome.getCondition().getClreplaced()));
message.append(String.format(")%n"));
}
18
Source : LepServicesRegistrar.java
with Apache License 2.0
from xm-online
with Apache License 2.0
from xm-online
private static String getBeanName(AnnotationMetadata annotationMetadata, Map<String, Object> attributes) {
// name & value are aliases
String beanName = (String) attributes.get("value");
if (!StringUtils.isEmpty(beanName)) {
return beanName;
} else {
// generate bean name from clreplaced name
String shortName = ClreplacedUtils.getShortName(annotationMetadata.getClreplacedName());
return StringUtils.uncapitalize(shortName);
}
}
18
Source : NettyRpcClientBeanDefinitionRegistrar.java
with Apache License 2.0
from wangzihaogithub
with Apache License 2.0
from wangzihaogithub
public String generateBeanName(String beanClreplacedName) {
return Introspector.decapitalize(ClreplacedUtils.getShortName(beanClreplacedName));
}
18
Source : DefaultToStringStyler.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
@Override
public void styleStart(StringBuilder buffer, Object obj) {
if (!obj.getClreplaced().isArray()) {
buffer.append('[').append(ClreplacedUtils.getShortName(obj.getClreplaced()));
styleIdenreplacedyHashCode(buffer, obj);
} else {
buffer.append('[');
styleIdenreplacedyHashCode(buffer, obj);
buffer.append(' ');
styleValue(buffer, obj);
}
}
18
Source : DefaultClassDescriptor.java
with Apache License 2.0
from spring-projects-experimental
with Apache License 2.0
from spring-projects-experimental
@Override
public String getShortName() {
return ClreplacedUtils.getShortName(this.clreplacedName);
}
18
Source : RiotCommand.java
with Apache License 2.0
from redis-developer
with Apache License 2.0
from redis-developer
protected <B extends CommandTimeoutBuilder<B>> B configureCommandTimeoutBuilder(B builder) {
Duration commandTimeout = getRedisURI().getTimeout();
log.info("Configuring {} with command timeout {}", ClreplacedUtils.getShortName(builder.getClreplaced()), commandTimeout);
return builder.commandTimeout(commandTimeout);
}
18
Source : AmazonWebserviceClientConfigurationUtils.java
with Apache License 2.0
from awspring
with Apache License 2.0
from awspring
public static String getBeanName(String serviceClreplacedName) {
String clientClreplacedName = ClreplacedUtils.getShortName(serviceClreplacedName);
String shortenedClreplacedName = StringUtils.delete(clientClreplacedName, SERVICE_IMPLEMENTATION_SUFFIX);
return Introspector.decapitalize(shortenedClreplacedName);
}
17
Source : NoSuchBeanDefinitionFailureAnalyzerTests.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
private void replacedertBeanMethodDisabled(Failurereplacedysis replacedysis, String description, Clreplaced<?> target, String methodName) {
String expected = String.format("Bean method '%s' in '%s' not loaded because", methodName, ClreplacedUtils.getShortName(target));
replacedertThat(replacedysis.getDescription()).contains(expected);
replacedertThat(replacedysis.getDescription()).contains(description);
}
17
Source : NoSuchBeanDefinitionFailureAnalyzerTests.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
private void replacedertUserDefinedBean(Failurereplacedysis replacedysis, String description, Clreplaced<?> target, String methodName) {
String expected = String.format("User-defined bean method '%s' in '%s' ignored", methodName, ClreplacedUtils.getShortName(target));
replacedertThat(replacedysis.getDescription()).contains(expected);
replacedertThat(replacedysis.getDescription()).contains(description);
}
17
Source : NoSuchBeanDefinitionFailureAnalyzerTests.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
@Test
public void failurereplacedysisForSeveralConditionsType() {
Failurereplacedysis replacedysis = replacedyzeFailure(createFailure(SeveralAutoConfigurationTypeConfiguration.clreplaced));
replacedertDescriptionConstructorMissingType(replacedysis, StringHandler.clreplaced, 0, String.clreplaced);
replacedertBeanMethodDisabled(replacedysis, "did not find property 'spring.string.enabled'", TestPropertyAutoConfiguration.clreplaced, "string");
replacedertClreplacedDisabled(replacedysis, "did not find required clreplaced 'com.example.FooBar'", "string", ClreplacedUtils.getShortName(TestPropertyAutoConfiguration.clreplaced));
replacedertActionMissingType(replacedysis, String.clreplaced);
}
17
Source : NoSuchBeanDefinitionFailureAnalyzerTests.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
@Test
public void failurereplacedysisForMissingClreplacedOnAutoConfigurationType() {
Failurereplacedysis replacedysis = replacedyzeFailure(createFailure(MissingClreplacedOnAutoConfigurationConfiguration.clreplaced));
replacedertDescriptionConstructorMissingType(replacedysis, StringHandler.clreplaced, 0, String.clreplaced);
replacedertClreplacedDisabled(replacedysis, "did not find required clreplaced 'com.example.FooBar'", "string", ClreplacedUtils.getShortName(TestTypeClreplacedAutoConfiguration.clreplaced));
replacedertActionMissingType(replacedysis, String.clreplaced);
}
17
Source : NoSuchBeanDefinitionFailureAnalyzer.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
private void collectExcludedAutoConfiguration(NoSuchBeanDefinitionException cause, List<AutoConfigurationResult> results) {
for (String excludedClreplaced : this.report.getExclusions()) {
Source source = new Source(excludedClreplaced);
BeanMethods methods = new BeanMethods(source, cause);
for (MethodMetadata method : methods) {
String message = String.format("auto-configuration '%s' was excluded", ClreplacedUtils.getShortName(excludedClreplaced));
results.add(new AutoConfigurationResult(method, new ConditionOutcome(false, message)));
}
}
}
17
Source : DefaultValueStyler.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
@Override
public String style(@Nullable Object value) {
if (value == null) {
return NULL;
} else if (value instanceof String) {
return "\'" + value + "\'";
} else if (value instanceof Clreplaced) {
return ClreplacedUtils.getShortName((Clreplaced<?>) value);
} else if (value instanceof Method) {
Method method = (Method) value;
return method.getName() + "@" + ClreplacedUtils.getShortName(method.getDeclaringClreplaced());
} else if (value instanceof Map) {
return style((Map<?, ?>) value);
} else if (value instanceof Map.Entry) {
return style((Map.Entry<?, ?>) value);
} else if (value instanceof Collection) {
return style((Collection<?>) value);
} else if (value.getClreplaced().isArray()) {
return styleArray(ObjectUtils.toObjectArray(value));
} else {
return String.valueOf(value);
}
}
17
Source : DefaultSchemaNameBuilder.java
with Apache License 2.0
from qaware
with Apache License 2.0
from qaware
@Override
public String buildFromType(JavaType javaType) {
// works better for nested clreplacedes
return ClreplacedUtils.getShortName(javaType.getRawClreplaced());
}
17
Source : DefaultToShortClassNameBeanNameGenerator.java
with Apache License 2.0
from onap
with Apache License 2.0
from onap
@Override
protected String buildDefaultBeanName(BeanDefinition definition) {
return ClreplacedUtils.getShortName(definition.getBeanClreplacedName());
}
17
Source : DefaultValueStyler.java
with Apache License 2.0
from langtianya
with Apache License 2.0
from langtianya
@Override
public String style(Object value) {
if (value == null) {
return NULL;
} else if (value instanceof String) {
return "\'" + value + "\'";
} else if (value instanceof Clreplaced) {
return ClreplacedUtils.getShortName((Clreplaced<?>) value);
} else if (value instanceof Method) {
Method method = (Method) value;
return method.getName() + "@" + ClreplacedUtils.getShortName(method.getDeclaringClreplaced());
} else if (value instanceof Map) {
return style((Map<?, ?>) value);
} else if (value instanceof Map.Entry) {
return style((Map.Entry<?, ?>) value);
} else if (value instanceof Collection) {
return style((Collection<?>) value);
} else if (value.getClreplaced().isArray()) {
return styleArray(ObjectUtils.toObjectArray(value));
} else {
return String.valueOf(value);
}
}
17
Source : AbstractInterceptorDrivenBeanDefinitionDecorator.java
with Apache License 2.0
from langtianya
with Apache License 2.0
from langtianya
protected String getInterceptorNameSuffix(BeanDefinition interceptorDefinition) {
return StringUtils.uncapitalize(ClreplacedUtils.getShortName(interceptorDefinition.getBeanClreplacedName()));
}
17
Source : NoSuchBeanDefinitionFailureAnalyzer.java
with Apache License 2.0
from hello-shf
with Apache License 2.0
from hello-shf
private void collectExcludedAutoConfiguration(NoSuchBeanDefinitionException cause, List<AutoConfigurationResult> results) {
for (String excludedClreplaced : this.report.getExclusions()) {
Source source = new Source(excludedClreplaced);
BeanMethods methods = new BeanMethods(source, cause);
for (MethodMetadata method : methods) {
String message = String.format("auto-configuration '%s' was excluded", ClreplacedUtils.getShortName(excludedClreplaced));
results.add(new AutoConfigurationResult(method, new ConditionOutcome(false, message), false));
}
}
}
17
Source : TestCommand.java
with GNU General Public License v3.0
from atomist-attic
with GNU General Public License v3.0
from atomist-attic
private String resultName(replacedertionResult result) {
String name = ClreplacedUtils.getShortName(result.result().getClreplaced());
if (name.endsWith(".")) {
name = name.substring(0, name.length() - 1);
}
switch(name) {
case "Preplaceded":
name = Style.green(name);
break;
case "NotYetImplemented":
name = Style.yellow(name);
break;
case "Failed":
name = Style.red(name);
break;
}
return name;
}
16
Source : NoSuchBeanDefinitionFailureAnalyzerTests.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
@Test
public void failurereplacedysisForExcludedAutoConfigurationType() {
FatalBeanException failure = createFailure(StringHandler.clreplaced);
addExclusions(this.replacedyzer, TestPropertyAutoConfiguration.clreplaced);
Failurereplacedysis replacedysis = replacedyzeFailure(failure);
replacedertDescriptionConstructorMissingType(replacedysis, StringHandler.clreplaced, 0, String.clreplaced);
String configClreplaced = ClreplacedUtils.getShortName(TestPropertyAutoConfiguration.clreplaced.getName());
replacedertClreplacedDisabled(replacedysis, String.format("auto-configuration '%s' was excluded", configClreplaced), "string", ClreplacedUtils.getShortName(TestPropertyAutoConfiguration.clreplaced));
replacedertActionMissingType(replacedysis, String.clreplaced);
}
16
Source : AutoConfigurationImportSelectorIntegrationTests.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
private List<String> getImportedConfigBeans(replacedertableApplicationContext context) {
String shortName = ClreplacedUtils.getShortName(AutoConfigurationImportSelectorIntegrationTests.clreplaced);
int beginIndex = shortName.length() + 1;
List<String> orderedConfigBeans = new ArrayList<>();
for (String bean : context.getBeanDefinitionNames()) {
if (bean.contains("$Config")) {
String shortBeanName = ClreplacedUtils.getShortName(bean);
orderedConfigBeans.add(shortBeanName.substring(beginIndex));
}
}
return orderedConfigBeans;
}
16
Source : MetadataNamingStrategy.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
/**
* Reads the {@code ObjectName} from the source-level metadata replacedociated
* with the managed resource's {@code Clreplaced}.
*/
@Override
public ObjectName getObjectName(Object managedBean, @Nullable String beanKey) throws MalformedObjectNameException {
replacedert.state(this.attributeSource != null, "No JmxAttributeSource set");
Clreplaced<?> managedClreplaced = AopUtils.getTargetClreplaced(managedBean);
ManagedResource mr = this.attributeSource.getManagedResource(managedClreplaced);
// Check that an object name has been specified.
if (mr != null && StringUtils.hasText(mr.getObjectName())) {
return ObjectNameManager.getInstance(mr.getObjectName());
} else {
replacedert.state(beanKey != null, "No ManagedResource attribute and no bean key specified");
try {
return ObjectNameManager.getInstance(beanKey);
} catch (MalformedObjectNameException ex) {
String domain = this.defaultDomain;
if (domain == null) {
domain = ClreplacedUtils.getPackageName(managedClreplaced);
}
Hashtable<String, String> properties = new Hashtable<>();
properties.put("type", ClreplacedUtils.getShortName(managedClreplaced));
properties.put("name", beanKey);
return ObjectNameManager.getInstance(domain, properties);
}
}
}
16
Source : IdentityNamingStrategy.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
/**
* Returns an instance of {@code ObjectName} based on the idenreplacedy
* of the managed resource.
*/
@Override
public ObjectName getObjectName(Object managedBean, @Nullable String beanKey) throws MalformedObjectNameException {
String domain = ClreplacedUtils.getPackageName(managedBean.getClreplaced());
Hashtable<String, String> keys = new Hashtable<>();
keys.put(TYPE_KEY, ClreplacedUtils.getShortName(managedBean.getClreplaced()));
keys.put(HASH_CODE_KEY, ObjectUtils.getIdenreplacedyHexString(managedBean));
return ObjectNameManager.getInstance(domain, keys);
}
16
Source : MetadataNamingStrategy.java
with Apache License 2.0
from langtianya
with Apache License 2.0
from langtianya
/**
* Reads the {@code ObjectName} from the source-level metadata replacedociated
* with the managed resource's {@code Clreplaced}.
*/
@Override
public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException {
Clreplaced<?> managedClreplaced = AopUtils.getTargetClreplaced(managedBean);
ManagedResource mr = this.attributeSource.getManagedResource(managedClreplaced);
// Check that an object name has been specified.
if (mr != null && StringUtils.hasText(mr.getObjectName())) {
return ObjectNameManager.getInstance(mr.getObjectName());
} else {
try {
return ObjectNameManager.getInstance(beanKey);
} catch (MalformedObjectNameException ex) {
String domain = this.defaultDomain;
if (domain == null) {
domain = ClreplacedUtils.getPackageName(managedClreplaced);
}
Hashtable<String, String> properties = new Hashtable<String, String>();
properties.put("type", ClreplacedUtils.getShortName(managedClreplaced));
properties.put("name", beanKey);
return ObjectNameManager.getInstance(domain, properties);
}
}
}
16
Source : IdentityNamingStrategy.java
with Apache License 2.0
from langtianya
with Apache License 2.0
from langtianya
/**
* Returns an instance of {@code ObjectName} based on the idenreplacedy
* of the managed resource.
*/
@Override
public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException {
String domain = ClreplacedUtils.getPackageName(managedBean.getClreplaced());
Hashtable<String, String> keys = new Hashtable<String, String>();
keys.put(TYPE_KEY, ClreplacedUtils.getShortName(managedBean.getClreplaced()));
keys.put(HASH_CODE_KEY, ObjectUtils.getIdenreplacedyHexString(managedBean));
return ObjectNameManager.getInstance(domain, keys);
}
16
Source : AnnotationBeanNameGenerator.java
with Apache License 2.0
from langtianya
with Apache License 2.0
from langtianya
/**
* Derive a default bean name from the given bean definition.
* <p>The default implementation simply builds a decapitalized version
* of the short clreplaced name: e.g. "mypackage.MyJdbcDao" -> "myJdbcDao".
* <p>Note that inner clreplacedes will thus have names of the form
* "outerClreplacedName.InnerClreplacedName", which because of the period in the
* name may be an issue if you are autowiring by name.
* @param definition the bean definition to build a bean name for
* @return the default bean name (never {@code null})
*/
protected String buildDefaultBeanName(BeanDefinition definition) {
String shortClreplacedName = ClreplacedUtils.getShortName(definition.getBeanClreplacedName());
return Introspector.decapitalize(shortClreplacedName);
}
16
Source : Java110ListenerDiscoveryRegistrar.java
with Apache License 2.0
from java110
with Apache License 2.0
from java110
/**
* 获取名称
* @param listeners
* @param beanDefinition
* @return
*/
private String getListenerName(Map<String, Object> listeners, AnnotatedBeanDefinition beanDefinition) {
if (listeners == null) {
String shortClreplacedName = ClreplacedUtils.getShortName(beanDefinition.getBeanClreplacedName());
return Introspector.decapitalize(shortClreplacedName);
}
String value = (String) listeners.get("value");
if (!StringUtils.hasText(value)) {
value = (String) listeners.get("name");
}
if (StringUtils.hasText(value)) {
return value;
}
String shortClreplacedName = ClreplacedUtils.getShortName(beanDefinition.getBeanClreplacedName());
value = Introspector.decapitalize(shortClreplacedName);
return value;
}
15
Source : AnnotationsScannerTests.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
private Stream<String> scan(AnnotatedElement element, SearchStrategy searchStrategy) {
List<String> result = new ArrayList<>();
AnnotationsScanner.scan(this, element, searchStrategy, (criteria, aggregateIndex, source, annotations) -> {
for (Annotation annotation : annotations) {
if (annotation != null) {
String name = ClreplacedUtils.getShortName(annotation.annotationType());
name = name.substring(name.lastIndexOf(".") + 1);
result.add(aggregateIndex + ":" + name);
}
}
return null;
});
return result.stream();
}
15
Source : IdentityNamingStrategyTests.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
@Test
public void naming() throws MalformedObjectNameException {
JmxTestBean bean = new JmxTestBean();
IdenreplacedyNamingStrategy strategy = new IdenreplacedyNamingStrategy();
ObjectName objectName = strategy.getObjectName(bean, "null");
replacedertEquals("Domain is incorrect", bean.getClreplaced().getPackage().getName(), objectName.getDomain());
replacedertEquals("Type property is incorrect", ClreplacedUtils.getShortName(bean.getClreplaced()), objectName.getKeyProperty(IdenreplacedyNamingStrategy.TYPE_KEY));
replacedertEquals("HashCode property is incorrect", ObjectUtils.getIdenreplacedyHexString(bean), objectName.getKeyProperty(IdenreplacedyNamingStrategy.HASH_CODE_KEY));
}
15
Source : AnnotationBeanNameGenerator.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
/**
* Derive a default bean name from the given bean definition.
* <p>The default implementation simply builds a decapitalized version
* of the short clreplaced name: e.g. "mypackage.MyJdbcDao" -> "myJdbcDao".
* <p>Note that inner clreplacedes will thus have names of the form
* "outerClreplacedName.InnerClreplacedName", which because of the period in the
* name may be an issue if you are autowiring by name.
* @param definition the bean definition to build a bean name for
* @return the default bean name (never {@code null})
*/
protected String buildDefaultBeanName(BeanDefinition definition) {
String beanClreplacedName = definition.getBeanClreplacedName();
replacedert.state(beanClreplacedName != null, "No bean clreplaced name set");
String shortClreplacedName = ClreplacedUtils.getShortName(beanClreplacedName);
return Introspector.decapitalize(shortClreplacedName);
}
15
Source : ClassUtilsTests.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
@Test
public void getShortNameForCglibClreplaced() {
TestBean tb = new TestBean();
ProxyFactory pf = new ProxyFactory();
pf.setTarget(tb);
pf.setProxyTargetClreplaced(true);
TestBean proxy = (TestBean) pf.getProxy();
String clreplacedName = ClreplacedUtils.getShortName(proxy.getClreplaced());
replacedertEquals("Clreplaced name did not match", "TestBean", clreplacedName);
}
15
Source : IdentityNamingStrategyTests.java
with Apache License 2.0
from SourceHot
with Apache License 2.0
from SourceHot
@Test
public void naming() throws MalformedObjectNameException {
JmxTestBean bean = new JmxTestBean();
IdenreplacedyNamingStrategy strategy = new IdenreplacedyNamingStrategy();
ObjectName objectName = strategy.getObjectName(bean, "null");
replacedertThat(objectName.getDomain()).as("Domain is incorrect").isEqualTo(bean.getClreplaced().getPackage().getName());
replacedertThat(objectName.getKeyProperty(IdenreplacedyNamingStrategy.TYPE_KEY)).as("Type property is incorrect").isEqualTo(ClreplacedUtils.getShortName(bean.getClreplaced()));
replacedertThat(objectName.getKeyProperty(IdenreplacedyNamingStrategy.HASH_CODE_KEY)).as("HashCode property is incorrect").isEqualTo(ObjectUtils.getIdenreplacedyHexString(bean));
}
15
Source : AnnotationBeanNameGenerator.java
with Apache License 2.0
from SourceHot
with Apache License 2.0
from SourceHot
/**
* Derive a default bean name from the given bean definition.
* <p>The default implementation simply builds a decapitalized version
* of the short clreplaced name: e.g. "mypackage.MyJdbcDao" -> "myJdbcDao".
* <p>Note that inner clreplacedes will thus have names of the form
* "outerClreplacedName.InnerClreplacedName", which because of the period in the
* name may be an issue if you are autowiring by name.
* @param definition the bean definition to build a bean name for
* @return the default bean name (never {@code null})
*/
protected String buildDefaultBeanName(BeanDefinition definition) {
// 获取 clreplaced name、
String beanClreplacedName = definition.getBeanClreplacedName();
replacedert.state(beanClreplacedName != null, "No bean clreplaced name set");
// 获取短类名
String shortClreplacedName = ClreplacedUtils.getShortName(beanClreplacedName);
// 首字母小写
return Introspector.decapitalize(shortClreplacedName);
}
15
Source : ClassUtilsTests.java
with Apache License 2.0
from SourceHot
with Apache License 2.0
from SourceHot
@Test
public void getShortNameForCglibClreplaced() {
TestBean tb = new TestBean();
ProxyFactory pf = new ProxyFactory();
pf.setTarget(tb);
pf.setProxyTargetClreplaced(true);
TestBean proxy = (TestBean) pf.getProxy();
String clreplacedName = ClreplacedUtils.getShortName(proxy.getClreplaced());
replacedertThat(clreplacedName).as("Clreplaced name did not match").isEqualTo("TestBean");
}
15
Source : RouteBeanNameGenerator.java
with Apache License 2.0
from OpenWiseSolutions
with Apache License 2.0
from OpenWiseSolutions
protected String buildRouteBeanName(BeanDefinition definition) {
String shortClreplacedName = ClreplacedUtils.getShortName(definition.getBeanClreplacedName());
String beanName = Introspector.decapitalize(shortClreplacedName);
if (StringUtils.contains(definition.getBeanClreplacedName(), MODULES_PACKAGE_IN)) {
beanName += MODULES_IN;
} else if (StringUtils.contains(definition.getBeanClreplacedName(), MODULES_PACKAGE_OUT)) {
beanName += MODULES_OUT;
}
beanName += BEAN_SUFFIX;
return beanName;
}
14
Source : ModelMapTests.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
@Test
public void testAddMap() throws Exception {
Map<String, String> map = new HashMap<>();
map.put("one", "one-value");
map.put("two", "two-value");
ModelMap model = new ModelMap();
model.addAttribute(map);
replacedertEquals(1, model.size());
String key = StringUtils.uncapitalize(ClreplacedUtils.getShortName(map.getClreplaced()));
replacedertTrue(model.containsKey(key));
}
14
Source : DynamicDataSourcePointcut.java
with Apache License 2.0
from TFdream
with Apache License 2.0
from TFdream
@Override
public boolean matches(Method method, Clreplaced<?> targetClreplaced) {
boolean b = isMatchMethod(method, targetClreplaced);
if (b) {
if (LOG.isDebugEnabled()) {
LOG.debug("check method match true, method={}, declaringClreplaced={}, targetClreplaced={}", method.getName(), ClreplacedUtils.getShortName(method.getDeclaringClreplaced()), targetClreplaced == null ? null : ClreplacedUtils.getShortName(targetClreplaced));
}
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("check method match false, method={}, declaringClreplaced={}, targetClreplaced={}", method.getName(), ClreplacedUtils.getShortName(method.getDeclaringClreplaced()), targetClreplaced == null ? null : ClreplacedUtils.getShortName(targetClreplaced));
}
}
return b;
}
See More Examples