com.sun.tools.xjc.reader
Class TypeUtil

java.lang.Object
  extended by com.sun.tools.xjc.reader.TypeUtil

public class TypeUtil
extends java.lang.Object

Type-related utility methods.


Constructor Summary
TypeUtil()
           
 
Method Summary
static com.sun.codemodel.JType getCommonBaseType(com.sun.codemodel.JCodeModel codeModel, java.util.Collection<? extends com.sun.codemodel.JType> types)
          Computes the common base type of two types.
static com.sun.codemodel.JType getCommonBaseType(com.sun.codemodel.JCodeModel codeModel, com.sun.codemodel.JType... t)
          Computes the common base type of types.
static com.sun.codemodel.JType getType(com.sun.codemodel.JCodeModel codeModel, java.lang.String typeName, ErrorReceiver errorHandler, org.xml.sax.Locator errorSource)
          Obtains a JType object for the string representation of a type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeUtil

public TypeUtil()
Method Detail

getCommonBaseType

public static com.sun.codemodel.JType getCommonBaseType(com.sun.codemodel.JCodeModel codeModel,
                                                        java.util.Collection<? extends com.sun.codemodel.JType> types)
Computes the common base type of two types.

Parameters:
types - set of JType objects.

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,
                                              java.lang.String typeName,
                                              ErrorReceiver errorHandler,
                                              org.xml.sax.Locator errorSource)
Obtains a JType object for the string representation of a type.