private boolean isOverlayArrayType(JClassType type) { for (JClassType arrayType : OVERLAY_ARRAY_TYPES) { if (type.isAssignableTo(arrayType)) { return true; } } return false; }
@Override public boolean isCollectionType(JClassType clazz) { return clazz != null && (clazz.isAssignableTo(SET_TYPE) || clazz.isAssignableTo(LIST_TYPE) || clazz.isAssignableTo(MAP_TYPE) || clazz.isAssignableTo(COLLECTION_TYPE)); }
private boolean isOverlayArrayType(JClassType type) { for (JClassType arrayType : OVERLAY_ARRAY_TYPES) { if (type.isAssignableTo(arrayType)) { return true; } } return false; }
@Override public boolean isCollectionType(JClassType clazz) { return clazz != null && (clazz.isAssignableTo(SET_TYPE) || clazz.isAssignableTo(LIST_TYPE) || clazz.isAssignableTo(MAP_TYPE) || clazz.isAssignableTo(COLLECTION_TYPE)); }
/** * <p>isObjectWriter</p> * * @param type a {@link com.google.gwt.core.ext.typeinfo.JClassType} object. * @return a boolean. */ public boolean isObjectWriter( JClassType type ) { return type.isAssignableTo( objectWriterType ); }
/** * <p>isIterable</p> * * @param parameterizedType a {@link com.google.gwt.core.ext.typeinfo.JClassType} object. * @return a boolean. */ public boolean isIterable( JClassType parameterizedType ) { return parameterizedType.isAssignableTo( iterableType ); }
/** * <p>isObjectReader</p> * * @param type a {@link com.google.gwt.core.ext.typeinfo.JClassType} object. * @return a boolean. */ public boolean isObjectReader( JClassType type ) { return type.isAssignableTo( objectReaderType ); }
private boolean isQueryParamListType(JClassType type) { if (type.isParameterized() == null) { return false; } for (JClassType listType : QUERY_PARAM_LIST_TYPES) { if (type.isAssignableTo(listType)) { return true; } } return false; }
static boolean isAutoSerializable(JClassType type) { try { JClassType isSerializable = getIsSerializableMarkerInterface(type); JClassType serializable = getSerializableMarkerInterface(type); return type.isAssignableTo(isSerializable) || type.isAssignableTo(serializable); } catch (NotFoundException e) { return false; } }
private boolean isQueryParamListType(JClassType type) { if (type.isParameterized() == null) { return false; } for (JClassType listType : QUERY_PARAM_LIST_TYPES) { if (type.isAssignableTo(listType)) { return true; } } return false; }
/** * <p>isKeyDeserializer</p> * * @param type a {@link com.google.gwt.core.ext.typeinfo.JType} object. * @return a boolean. */ public boolean isKeyDeserializer( JType type ) { return null != type.isClass() && type.isClass().isAssignableTo( keyDeserializerType ); }
/** * <p>isJsonSerializer</p> * * @param type a {@link com.google.gwt.core.ext.typeinfo.JType} object. * @return a boolean. */ public boolean isJsonSerializer( JType type ) { return null != type.isClass() && type.isClass().isAssignableTo( jsonSerializerType ); }
/** * <p>isKeySerializer</p> * * @param type a {@link com.google.gwt.core.ext.typeinfo.JType} object. * @return a boolean. */ public boolean isKeySerializer( JType type ) { return null != type.isClass() && type.isClass().isAssignableTo( keySerializerType ); }
protected String isListEncoderDecoder(JClassType clazz, JClassType[] types, Style style) throws UnableToCompleteException { if (clazz.isAssignableTo(LIST_TYPE)) { if (types.length != 1) { error("List must define one and only one type parameter"); } String encoderDecoder = getNestedEncoderDecoder(types[0], style); debug("type encoder for: " + types[0] + " is " + encoderDecoder); return encoderDecoder; } return null; }
protected String isSetEncoderDecoder(JClassType clazz, JClassType[] types, Style style) throws UnableToCompleteException { if (clazz.isAssignableTo(SET_TYPE)) { if (types.length != 1) { error("Set must define one and only one type parameter"); } String encoderDecoder = getNestedEncoderDecoder(types[0], style); debug("type encoder for: " + types[0] + " is " + encoderDecoder); return encoderDecoder; } return null; }
protected String isListEncoderDecoder(JClassType clazz, JClassType[] types, Style style) throws UnableToCompleteException { if (clazz.isAssignableTo(LIST_TYPE)) { if (types.length != 1) { error("List must define one and only one type parameter"); } String encoderDecoder = getNestedEncoderDecoder(types[0], style); debug("type encoder for: " + types[0] + " is " + encoderDecoder); return encoderDecoder; } return null; }
protected String isCollectionEncoderDecoder(JClassType clazz, JClassType[] types, Style style) throws UnableToCompleteException { if (clazz.isAssignableTo(COLLECTION_TYPE)) { if (types.length != 1) { error("Collection must define one and only one type parameter"); } String encoderDecoder = getNestedEncoderDecoder(types[0], style); debug("type encoder for: " + types[0] + " is " + encoderDecoder); return encoderDecoder; } return null; }
protected String isCollectionEncoderDecoder(JClassType clazz, JClassType[] types, Style style) throws UnableToCompleteException { if (clazz.isAssignableTo(COLLECTION_TYPE)) { if (types.length != 1) { error("Collection must define one and only one type parameter"); } String encoderDecoder = getNestedEncoderDecoder(types[0], style); debug("type encoder for: " + types[0] + " is " + encoderDecoder); return encoderDecoder; } return null; }
protected String isSetEncoderDecoder(JClassType clazz, JClassType[] types, Style style) throws UnableToCompleteException { if (clazz.isAssignableTo(SET_TYPE)) { if (types.length != 1) { error("Set must define one and only one type parameter"); } String encoderDecoder = getNestedEncoderDecoder(types[0], style); debug("type encoder for: " + types[0] + " is " + encoderDecoder); return encoderDecoder; } return null; }
private void tryGenerateDelegate() throws NotFoundException, UnableToCompleteException { JClassType resourceDelegateType = typeOracle.getType(ResourceDelegate.class.getName()); JClassType type = typeOracle.getType(typeName); JClassType[] implementedInterfaces = type.getImplementedInterfaces(); for (JClassType implementedInterface : implementedInterfaces) { if (implementedInterface.isAssignableTo(resourceDelegateType)) { doGenerate(type, implementedInterface); return; } } throw new UnableToCompleteException(); }