List of usage examples for com.google.gwt.dev.asm Type getDescriptor
public String getDescriptor()
From source file:com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidator.java
License:Apache License
/** * This looks like it should be a utility method somewhere else, but I can't * find it./*from w w w . j a va 2 s . c o m*/ */ private Type getBoxedType(Type primitive) { switch (primitive.getSort()) { case Type.BOOLEAN: return Type.getType(Boolean.class); case Type.BYTE: return Type.getType(Byte.class); case Type.CHAR: return Type.getType(Character.class); case Type.DOUBLE: return Type.getType(Double.class); case Type.FLOAT: return Type.getType(Float.class); case Type.INT: return Type.getType(Integer.class); case Type.LONG: return Type.getType(Long.class); case Type.SHORT: return Type.getType(Short.class); case Type.VOID: return Type.getType(Void.class); } throw new RuntimeException(primitive.getDescriptor() + " is not a primitive type"); }
From source file:com.google.web.bindery.requestfactory.server.RequestFactoryJarExtractor.java
License:Apache License
/** * Process a type, possibly returning a rebased type. * //from ww w . j a va 2 s. c o m * @param sourceType TODO */ private Type processType(String sourceType, Type type) { Type toReturn; synchronized (seen) { toReturn = seen.get(type); if (toReturn != null) { return toReturn; } toReturn = Type.getType(type.getDescriptor()); seen.put(type, toReturn); } int sort = type.getSort(); if (sort != Type.OBJECT && sort != Type.ARRAY) { return toReturn; } if (sort == Type.ARRAY) { processType(sourceType, type.getElementType()); return toReturn; } assert type.getInternalName().charAt(0) != 'L'; if (type.getInternalName().startsWith("java/") || type.getInternalName().startsWith("javax/")) { return toReturn; } if (VERBOSE) { System.out.println(sourceType + " -> " + type.getClassName()); } Future<State> future = ex.submit(new ProcessOneType(type)); inProcess.add(future); return toReturn; }
From source file:com.google.web.bindery.requestfactory.server.ResolverServiceLayer.java
License:Apache License
private Class<?> getClass(Type type) { switch (type.getSort()) { case Type.BOOLEAN: return boolean.class; case Type.BYTE: return byte.class; case Type.CHAR: return char.class; case Type.DOUBLE: return double.class; case Type.FLOAT: return float.class; case Type.INT: return int.class; case Type.LONG: return long.class; case Type.OBJECT: return forName(type.getClassName()); case Type.SHORT: return short.class; case Type.VOID: return void.class; case Type.ARRAY: return die(null, "Unsupported Type used in operation descriptor %s", type.getDescriptor()); default:/*ww w .jav a 2s .c om*/ // Error in this switch statement return die(null, "Unhandled Type: %s", type.getDescriptor()); } }