system/src/sc/lang/java/JavaType.java
public static Object createObjectType(Object dstPropType) {
      if (dstPropType instanceof Class) {
         Class cl = (Class) dstPropType;
         if (cl.isPrimitive()) {
            return ClassType.createPrimitiveWrapper(cl.getName().replace('$', '.'));
         }
         else if (cl.isArray()) {
            int ndim = 1;
            Class compType = cl.getComponentType();
            while (compType.isArray()) {
               ndim++;
               compType = compType.getComponentType();
            }
            JavaType res = compType.isPrimitive() ? PrimitiveType.create(compType.getName()) : ClassType.create(ModelUtil.getTypeName(compType));
            res.arrayDimensions = getDimsStr(ndim);
            return res;
         }
         return ClassType.create(StringUtil.split(cl.getName().replace('$', '.'), '.'));
      }
      else if (dstPropType instanceof ITypeDeclaration) {
         return ClassType.create(StringUtil.split(((ITypeDeclaration) dstPropType).getFullTypeName(), '.'));
      }
      else if (dstPropType instanceof TypeParameter) {
         return createObjectType(((TypeParameter) dstPropType).getTypeDeclaration());
      }
      else if (dstPropType instanceof ParameterizedType) {
         return ClassType.create(StringUtil.split(ModelUtil.getTypeName(dstPropType), '.'));
      }
      else
         throw new UnsupportedOperationException();
   }
/** Wraps primitive types in an object type wrapper for use in data binding where we only pass around objects (for now at least) */
Wraps primitive types in an object type wrapper for use in data binding where we only pass around objects (for now at least)
Wraps primitive types in an object type wrapper for use in data binding where we only pass around objects ( for now at least )
public static Object createObjectType(Object dstPropType) {
      if (dstPropType instanceof Class) {
         Class cl = (Class) dstPropType;
         if (cl.isPrimitive()) {
            return ClassType.createPrimitiveWrapper(cl.getName().replace('$', '.'));
         }
         else if (cl.isArray()) {
            int ndim = 1;
            Class compType = cl.getComponentType();
            while (compType.isArray()) {
               ndim++;
               compType = compType.getComponentType();
            }
            JavaType res = compType.isPrimitive() ? PrimitiveType.create(compType.getName()) : ClassType.create(ModelUtil.getTypeName(compType));
            res.arrayDimensions = getDimsStr(ndim);
            return res;
         }
         return ClassType.create(StringUtil.split(cl.getName().replace('$', '.'), '.'));
      }
      else if (dstPropType instanceof ITypeDeclaration) {
         return ClassType.create(StringUtil.split(((ITypeDeclaration) dstPropType).getFullTypeName(), '.'));
      }
      else if (dstPropType instanceof TypeParameter) {
         return createObjectType(((TypeParameter) dstPropType).getTypeDeclaration());
      }
      else if (dstPropType instanceof ParameterizedType) {
         return ClassType.create(StringUtil.split(ModelUtil.getTypeName(dstPropType), '.'));
      }
      else
         throw new UnsupportedOperationException();
   }
public static Object createObjectType ( Object dstPropType ) { if ( dstPropType instanceof Class ) { Class cl = ( Class ) dstPropType ; if ( cl . isPrimitive ( ) ) { return ClassType . createPrimitiveWrapper ( cl . getName ( ) . replace ( '$' , '.' ) ) ; } else if ( cl . isArray ( ) ) { int ndim = 1 ; Class compType = cl . getComponentType ( ) ; while ( compType . isArray ( ) ) { ndim ++ ; compType = compType . getComponentType ( ) ; } JavaType res = compType . isPrimitive ( ) ? PrimitiveType . create ( compType . getName ( ) ) : ClassType . create ( ModelUtil . getTypeName ( compType ) ) ; res . arrayDimensions = getDimsStr ( ndim ) ; return res ; } return ClassType . create ( StringUtil . split ( cl . getName ( ) . replace ( '$' , '.' ) , '.' ) ) ; } else if ( dstPropType instanceof ITypeDeclaration ) { return ClassType . create ( StringUtil . split ( ( ( ITypeDeclaration ) dstPropType ) . getFullTypeName ( ) , '.' ) ) ; } else if ( dstPropType instanceof TypeParameter ) { return createObjectType ( ( ( TypeParameter ) dstPropType ) . getTypeDeclaration ( ) ) ; } else if ( dstPropType instanceof ParameterizedType ) { return ClassType . create ( StringUtil . split ( ModelUtil . getTypeName ( dstPropType ) , '.' ) ) ; } else throw new UnsupportedOperationException ( ) ; }
Wraps primitive types in an object type wrapper for use in data binding where we only pass around objects (for now at least)
Wraps primitive types in an object type wrapper for use in data binding where we only pass around objects ( for now at least )