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

org.codehaus.groovy.runtime.InvokerHelper.toTypeString()方法的使用及代码示例

本文整理了Java中org.codehaus.groovy.runtime.InvokerHelper.toTypeString()方法的一些代码示例,展示了

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

InvokerHelper.toTypeString介绍

[英]A helper method to format the arguments types as a comma-separated list.
[中]将参数类型格式化为逗号分隔列表的帮助器方法。

代码示例

代码示例来源:origin: org.codehaus.groovy/groovy

/**
* A helper method to format the arguments types as a comma-separated list.
*
* @param arguments the type to process
* @return the string representation of the type
*/
public static String toTypeString(Object[] arguments) {
return toTypeString(arguments, -1);
}

代码示例来源:origin: org.codehaus.groovy/groovy

public String getMessage() {
return "No signature of method: "
+ (isStatic ? "static " : "")
+ type.getName()
+ "."
+ method
+ "() is applicable for argument types: ("
+ InvokerHelper.toTypeString(arguments, 60)
+ ") values: "
+ InvokerHelper.toArrayString(arguments, 60, true)
+ MethodRankHelper.getMethodSuggestionString(method, type, arguments);
}

代码示例来源:origin: org.codehaus.groovy/groovy

private CachedConstructor createCachedConstructor(Object[] arguments) {
if (arguments == null) arguments = EMPTY_ARGUMENTS;
Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments);
MetaClassHelper.unwrap(arguments);
CachedConstructor cOnstructor= (CachedConstructor) chooseMethod("", constructors, argClasses);
if (cOnstructor== null) {
cOnstructor= (CachedConstructor) chooseMethod("", constructors, argClasses);
}
if (cOnstructor== null) {
throw new GroovyRuntimeException(
"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");
}
return constructor;
}

代码示例来源:origin: org.codehaus.groovy/groovy

private Object invokeConstructor(Class at, Object[] arguments) {
checkInitalised();
if (arguments == null) arguments = EMPTY_ARGUMENTS;
Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments);
MetaClassHelper.unwrap(arguments);
CachedConstructor cOnstructor= (CachedConstructor) chooseMethod("", constructors, argClasses);
if (constructor != null) {
return constructor.doConstructorInvoke(arguments);
}
if (arguments.length == 1) {
Object firstArgument = arguments[0];
if (firstArgument instanceof Map) {
cOnstructor= (CachedConstructor) chooseMethod("", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY);
if (constructor != null) {
Object bean = constructor.doConstructorInvoke(MetaClassHelper.EMPTY_ARRAY);
setProperties(bean, ((Map) firstArgument));
return bean;
}
}
}
throw new GroovyRuntimeException(
"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");
}

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

public String getMessage() {
return "No signature of method: "
+ (isStatic ? "static " : "")
+ type.getName()
+ "."
+ method
+ "() is applicable for argument types: ("
+ InvokerHelper.toTypeString(arguments)
+ ") values: "
+ InvokerHelper.toString(arguments);
}

代码示例来源:origin: org.kohsuke.droovy/groovy

public String getMessage() {
return "No signature of method: "
+ (isStatic ? "static " : "")
+ type.getName()
+ "."
+ method
+ "() is applicable for argument types: ("
+ InvokerHelper.toTypeString(arguments)
+ ") values: "
+ InvokerHelper.toString(arguments);
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

public String getMessage() {
return "No signature of method: "
+ (isStatic ? "static " : "")
+ type.getName()
+ "."
+ method
+ "() is applicable for argument types: ("
+ InvokerHelper.toTypeString(arguments)
+ ") values: "
+ InvokerHelper.toString(arguments);
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public String getMessage() {
return "No signature of method: "
+ (isStatic ? "static " : "")
+ type.getName()
+ "."
+ method
+ "() is applicable for argument types: ("
+ InvokerHelper.toTypeString(arguments)
+ ") values: "
+ InvokerHelper.format(arguments, false, 40)
+ MethodRankHelper.getMethodSuggestionString(method, type, arguments);
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");

代码示例来源:origin: org.kohsuke.droovy/groovy

"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");

代码示例来源:origin: org.kohsuke.droovy/groovy

private Object invokeConstructor(Class at, Object[] arguments) {
checkInitalised();
if (arguments == null) arguments = EMPTY_ARGUMENTS;
Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments);
MetaClassHelper.unwrap(arguments);
CachedConstructor cOnstructor= (CachedConstructor) chooseMethod("", constructors, argClasses);
if (constructor != null) {
return constructor.doConstructorInvoke(arguments);
}
if (arguments.length == 1) {
Object firstArgument = arguments[0];
if (firstArgument instanceof Map) {
cOnstructor= (CachedConstructor) chooseMethod("", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY);
if (constructor != null) {
Object bean = constructor.doConstructorInvoke(MetaClassHelper.EMPTY_ARRAY);
setProperties(bean, ((Map) firstArgument));
return bean;
}
}
}
throw new GroovyRuntimeException(
"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

private Object invokeConstructor(Class at, Object[] arguments) {
checkInitalised();
if (arguments == null) arguments = EMPTY_ARGUMENTS;
Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments);
MetaClassHelper.unwrap(arguments);
CachedConstructor cOnstructor= (CachedConstructor) chooseMethod("", constructors, argClasses);
if (constructor != null) {
return constructor.doConstructorInvoke(arguments);
}
if (arguments.length == 1) {
Object firstArgument = arguments[0];
if (firstArgument instanceof Map) {
cOnstructor= (CachedConstructor) chooseMethod("", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY);
if (constructor != null) {
Object bean = constructor.doConstructorInvoke(MetaClassHelper.EMPTY_ARRAY);
setProperties(bean, ((Map) firstArgument));
return bean;
}
}
}
throw new GroovyRuntimeException(
"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

private Object invokeConstructor(Class at, Object[] arguments) {
checkInitalised();
if (arguments == null) arguments = EMPTY_ARGUMENTS;
Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments);
MetaClassHelper.unwrap(arguments);
CachedConstructor cOnstructor= (CachedConstructor) chooseMethod("", constructors, argClasses);
if (constructor != null) {
return constructor.doConstructorInvoke(arguments);
}
if (arguments.length == 1) {
Object firstArgument = arguments[0];
if (firstArgument instanceof Map) {
cOnstructor= (CachedConstructor) chooseMethod("", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY);
if (constructor != null) {
Object bean = constructor.doConstructorInvoke(MetaClassHelper.EMPTY_ARRAY);
setProperties(bean, ((Map) firstArgument));
return bean;
}
}
}
throw new GroovyRuntimeException(
"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");
}

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

private Object invokeConstructor(Class at, Object[] arguments) {
checkInitalised();
if (arguments == null) arguments = EMPTY_ARGUMENTS;
Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments);
unwrap(arguments);
CachedConstructor cOnstructor= (CachedConstructor) chooseMethod("", constructors, argClasses, false);
if (constructor != null) {
return doConstructorInvoke(at, constructor, arguments, true);
}
cOnstructor= (CachedConstructor) chooseMethod("", constructors, argClasses, true);
if (constructor != null) {
return doConstructorInvoke(at, constructor, arguments, true);
}
if (arguments.length == 1) {
Object firstArgument = arguments[0];
if (firstArgument instanceof Map) {
cOnstructor= (CachedConstructor) chooseMethod("", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY, false);
if (constructor != null) {
Object bean = doConstructorInvoke(at, constructor, MetaClassHelper.EMPTY_ARRAY, true);
setProperties(bean, ((Map) firstArgument));
return bean;
}
}
}
throw new GroovyRuntimeException(
"Could not find matching constructor for: "
+ theClass.getName()
+ "(" + InvokerHelper.toTypeString(arguments) + ")");
}

推荐阅读
author-avatar
dcwzyb_271
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有