public class TypeHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static Map<String,String> |
basicToWrapper |
| Constructor and Description |
|---|
TypeHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
assembleTypeParams(Collection<io.vertx.codegen.TypeParamInfo> typeParams,
boolean withTypeParams) |
static String |
assembleTypeParamsAsObjects(Collection<io.vertx.codegen.TypeParamInfo> typeParams) |
static String |
assembleTypeParamString(io.vertx.codegen.MethodInfo method) |
static String |
convertArgListToString(io.vertx.codegen.type.TypeInfo type,
boolean convert,
BiFunction<io.vertx.codegen.type.TypeInfo,Boolean,String> conversion) |
static String |
convertJavaArgListToString(io.vertx.codegen.type.TypeInfo type,
boolean convert) |
static String |
convertLink(io.vertx.codegen.doc.Text doc) |
static String |
convertScalaArgListToString(io.vertx.codegen.type.TypeInfo type,
boolean convert) |
static String |
convertToScalaNotation(String type) |
static String |
convertTypeToAliasedType(io.vertx.codegen.type.TypeInfo type)
Every usage of a Vert.x-Java-type has to be aliased.
|
static String |
createNameForMethodReturningAFuture(io.vertx.codegen.MethodInfo method)
Some method names require special treatment when used in lang-scala.
|
static boolean |
doesTypeRequireConversion(io.vertx.codegen.type.TypeInfo type) |
static String |
escapeIfKeyword(String possibleKeyword) |
static List<io.vertx.codegen.MethodInfo> |
findBasicMethods(List<io.vertx.codegen.MethodInfo> methods) |
static List<io.vertx.codegen.MethodInfo> |
findCacheReturnMethods(List<io.vertx.codegen.MethodInfo> methods) |
static List<io.vertx.codegen.MethodInfo> |
findDefaultMethods(List<io.vertx.codegen.MethodInfo> methods) |
static List<io.vertx.codegen.MethodInfo> |
findFluentMethods(List<io.vertx.codegen.MethodInfo> methods) |
static List<io.vertx.codegen.MethodInfo> |
findFutureMethods(List<io.vertx.codegen.MethodInfo> methods) |
static String |
fromObjectToInstanceOf(io.vertx.codegen.type.TypeInfo type) |
static String |
fromObjectToInstanceOf(io.vertx.codegen.type.TypeInfo type,
Collection<io.vertx.codegen.TypeParamInfo> typeParams,
Collection<? extends io.vertx.codegen.TypeParamInfo> methodTypeParams) |
static String |
fromPropertyInfoToScala(io.vertx.codegen.PropertyInfo info) |
static String |
fromPropertyInfoToScalaTypeWithConversion(io.vertx.codegen.type.TypeInfo type,
String name,
io.vertx.codegen.PropertyInfo info) |
static Set<String> |
generateImports(io.vertx.codegen.type.TypeInfo type,
Collection<io.vertx.codegen.type.TypeInfo> imps,
List<io.vertx.codegen.MethodInfo> methods) |
static void |
importForType(String packageName,
io.vertx.codegen.type.TypeInfo type,
Set<String> ret) |
static String |
invokeMethod(String target,
io.vertx.codegen.type.TypeInfo type,
io.vertx.codegen.MethodInfo method,
Collection<io.vertx.codegen.TypeParamInfo> typeParams) |
static String |
invokeMethodAndUseProvidedHandler(String target,
io.vertx.codegen.type.TypeInfo type,
io.vertx.codegen.MethodInfo method,
Collection<io.vertx.codegen.TypeParamInfo> typeParams,
String handler) |
static String |
invokeMethodWithoutConvertingReturn(String target,
io.vertx.codegen.type.TypeInfo type,
io.vertx.codegen.MethodInfo method,
Collection<io.vertx.codegen.TypeParamInfo> typeParams) |
static String |
invokeStaticMethod(String target,
io.vertx.codegen.type.TypeInfo type,
io.vertx.codegen.MethodInfo method) |
static boolean |
isAsyncResultHandler(io.vertx.codegen.type.TypeInfo type) |
static boolean |
isAsyncResultHandlerHandler(Element type) |
static boolean |
isKeyword(String possibleKeyword) |
static boolean |
isLastParamAsyncResultHandler(io.vertx.codegen.MethodInfo method) |
static boolean |
isMethodNeedsOverride(String callingClassName,
io.vertx.codegen.MethodInfo method) |
static boolean |
isParentConcrete(Collection<io.vertx.codegen.type.TypeInfo> superTypes) |
static String |
methodDoc(io.vertx.codegen.type.TypeInfo type,
io.vertx.codegen.MethodInfo method,
String indentation,
boolean future) |
static List<io.vertx.codegen.TypeParamInfo> |
removeLastParam(List<io.vertx.codegen.TypeParamInfo> params) |
static String |
renderDataObjectHtmlLink(io.vertx.codegen.type.TypeInfo type,
io.vertx.codegen.type.TypeInfo dataObjectType) |
static String |
renderDoc(io.vertx.codegen.type.TypeInfo type,
String margin,
io.vertx.codegen.doc.Doc doc) |
static String |
renderDocLink(io.vertx.codegen.type.TypeInfo type,
io.vertx.codegen.doc.Tag.Link link) |
static boolean |
shouldMethodReturnAFuture(io.vertx.codegen.MethodInfo method) |
static boolean |
skipMethod(io.vertx.codegen.MethodInfo method) |
static String |
toJavaType(io.vertx.codegen.type.TypeInfo type,
boolean convertTypeParamsToObject)
Generate the Java type name for a given Scala type name:
"scala.Int" becomes "java.lang.Integer"
|
static String |
toJavaWithConversion(String name,
io.vertx.codegen.type.TypeInfo type) |
static String |
toJavaWithConversion(String name,
io.vertx.codegen.type.TypeInfo type,
Collection<io.vertx.codegen.TypeParamInfo> typeParams,
Collection<? extends io.vertx.codegen.TypeParamInfo> methodTypeParams)
Generate conversion code to convert a given instance from Scala to Java:
'scala.Int' becomes 'scala.Int.asInstanceOf[java.lang.Integer]'
|
static String |
toScalaDocType(String type) |
static String |
toScalaType(io.vertx.codegen.type.TypeInfo type,
boolean convertTypeParamsToObject)
Generate the Scala type name for a given Java type name.
|
static String |
toScalaWithConversion(String name,
io.vertx.codegen.type.TypeInfo type,
Collection<io.vertx.codegen.TypeParamInfo> typeParams,
Collection<? extends io.vertx.codegen.TypeParamInfo> methodTypeParams)
Generate conversion code to convert a given instance from Java to Scala.
|
static String |
typeNameForPrimitiveScala(io.vertx.codegen.type.TypeInfo type) |
static io.vertx.codegen.type.TypeInfo |
typeOfReturnedFuture(io.vertx.codegen.MethodInfo method) |
static String |
wrapInOptionIfNullable(boolean nullable,
String expression) |
public static boolean doesTypeRequireConversion(io.vertx.codegen.type.TypeInfo type)
public static String convertArgListToString(io.vertx.codegen.type.TypeInfo type, boolean convert, BiFunction<io.vertx.codegen.type.TypeInfo,Boolean,String> conversion)
public static String convertScalaArgListToString(io.vertx.codegen.type.TypeInfo type, boolean convert)
public static String convertJavaArgListToString(io.vertx.codegen.type.TypeInfo type, boolean convert)
public static String toScalaWithConversion(String name, io.vertx.codegen.type.TypeInfo type, Collection<io.vertx.codegen.TypeParamInfo> typeParams, Collection<? extends io.vertx.codegen.TypeParamInfo> methodTypeParams)
public static String toScalaType(io.vertx.codegen.type.TypeInfo type, boolean convertTypeParamsToObject)
public static String toJavaWithConversion(String name, io.vertx.codegen.type.TypeInfo type)
public static String toJavaWithConversion(String name, io.vertx.codegen.type.TypeInfo type, Collection<io.vertx.codegen.TypeParamInfo> typeParams, Collection<? extends io.vertx.codegen.TypeParamInfo> methodTypeParams)
public static String toJavaType(io.vertx.codegen.type.TypeInfo type, boolean convertTypeParamsToObject)
public static String typeNameForPrimitiveScala(io.vertx.codegen.type.TypeInfo type)
public static String wrapInOptionIfNullable(boolean nullable, String expression)
public static String fromPropertyInfoToScalaTypeWithConversion(io.vertx.codegen.type.TypeInfo type, String name, io.vertx.codegen.PropertyInfo info)
public static String fromPropertyInfoToScala(io.vertx.codegen.PropertyInfo info)
public static String assembleTypeParams(Collection<io.vertx.codegen.TypeParamInfo> typeParams, boolean withTypeParams)
public static String assembleTypeParamsAsObjects(Collection<io.vertx.codegen.TypeParamInfo> typeParams)
public static String fromObjectToInstanceOf(io.vertx.codegen.type.TypeInfo type)
public static String fromObjectToInstanceOf(io.vertx.codegen.type.TypeInfo type, Collection<io.vertx.codegen.TypeParamInfo> typeParams, Collection<? extends io.vertx.codegen.TypeParamInfo> methodTypeParams)
public static boolean isKeyword(String possibleKeyword)
public static boolean isParentConcrete(Collection<io.vertx.codegen.type.TypeInfo> superTypes)
public static void importForType(String packageName, io.vertx.codegen.type.TypeInfo type, Set<String> ret)
public static Set<String> generateImports(io.vertx.codegen.type.TypeInfo type, Collection<io.vertx.codegen.type.TypeInfo> imps, List<io.vertx.codegen.MethodInfo> methods)
public static String convertTypeToAliasedType(io.vertx.codegen.type.TypeInfo type)
public static boolean skipMethod(io.vertx.codegen.MethodInfo method)
public static List<io.vertx.codegen.MethodInfo> findBasicMethods(List<io.vertx.codegen.MethodInfo> methods)
public static List<io.vertx.codegen.MethodInfo> findDefaultMethods(List<io.vertx.codegen.MethodInfo> methods)
public static List<io.vertx.codegen.MethodInfo> findFluentMethods(List<io.vertx.codegen.MethodInfo> methods)
public static List<io.vertx.codegen.MethodInfo> findCacheReturnMethods(List<io.vertx.codegen.MethodInfo> methods)
public static List<io.vertx.codegen.MethodInfo> findFutureMethods(List<io.vertx.codegen.MethodInfo> methods)
public static boolean isAsyncResultHandler(io.vertx.codegen.type.TypeInfo type)
public static boolean isLastParamAsyncResultHandler(io.vertx.codegen.MethodInfo method)
public static boolean isMethodNeedsOverride(String callingClassName, io.vertx.codegen.MethodInfo method)
public static io.vertx.codegen.type.TypeInfo typeOfReturnedFuture(io.vertx.codegen.MethodInfo method)
public static boolean shouldMethodReturnAFuture(io.vertx.codegen.MethodInfo method)
public static String invokeMethod(String target, io.vertx.codegen.type.TypeInfo type, io.vertx.codegen.MethodInfo method, Collection<io.vertx.codegen.TypeParamInfo> typeParams)
public static String assembleTypeParamString(io.vertx.codegen.MethodInfo method)
public static String invokeMethodWithoutConvertingReturn(String target, io.vertx.codegen.type.TypeInfo type, io.vertx.codegen.MethodInfo method, Collection<io.vertx.codegen.TypeParamInfo> typeParams)
public static String invokeMethodAndUseProvidedHandler(String target, io.vertx.codegen.type.TypeInfo type, io.vertx.codegen.MethodInfo method, Collection<io.vertx.codegen.TypeParamInfo> typeParams, String handler)
public static String invokeStaticMethod(String target, io.vertx.codegen.type.TypeInfo type, io.vertx.codegen.MethodInfo method)
public static List<io.vertx.codegen.TypeParamInfo> removeLastParam(List<io.vertx.codegen.TypeParamInfo> params)
public static String createNameForMethodReturningAFuture(io.vertx.codegen.MethodInfo method)
public static String methodDoc(io.vertx.codegen.type.TypeInfo type, io.vertx.codegen.MethodInfo method, String indentation, boolean future)
public static String renderDataObjectHtmlLink(io.vertx.codegen.type.TypeInfo type, io.vertx.codegen.type.TypeInfo dataObjectType)
public static String convertLink(io.vertx.codegen.doc.Text doc)
public static boolean isAsyncResultHandlerHandler(Element type)
public static String renderDocLink(io.vertx.codegen.type.TypeInfo type, io.vertx.codegen.doc.Tag.Link link)
Copyright © 2016–2018 vert.x. All rights reserved.