- java.lang.Object
-
- com.sun.tools.xjc.reader.TypeUtil
-
public class TypeUtil extends Object
Type-related utility methods.- Author:
- Kohsuke KAWAGUCHI
-
-
Constructor Summary
Constructors Constructor Description TypeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.sun.codemodel.JTypegetCommonBaseType(com.sun.codemodel.JCodeModel codeModel, com.sun.codemodel.JType... t)Computes the common base type of types.static com.sun.codemodel.JTypegetCommonBaseType(com.sun.codemodel.JCodeModel codeModel, Collection<? extends com.sun.codemodel.JType> types)Computes the common base type of two types.static com.sun.codemodel.JTypegetType(com.sun.codemodel.JCodeModel codeModel, String typeName, ErrorReceiver errorHandler, Locator errorSource)Obtains aJTypeobject for the string representation of a type.
-
-
-
Method Detail
-
getCommonBaseType
public static com.sun.codemodel.JType getCommonBaseType(com.sun.codemodel.JCodeModel codeModel, Collection<? extends com.sun.codemodel.JType> types)Computes the common base type of two types.- Parameters:
types- set ofJTypeobjects.
-
getCommonBaseType
public static com.sun.codemodel.JType getCommonBaseType(com.sun.codemodel.JCodeModel codeModel, com.sun.codemodel.JType... t)Computes the common base type of types. TODO: this is a very interesting problem. Since one type has possibly multiple base types, it's not an easy problem. The current implementation is very naive. To make the result deterministic across differente JVMs, we have to use a Set whose ordering is deterministic.
-
getType
public static com.sun.codemodel.JType getType(com.sun.codemodel.JCodeModel codeModel, String typeName, ErrorReceiver errorHandler, Locator errorSource)Obtains aJTypeobject for the string representation of a type.
-
-