JTypeParameter getTypeParameter() { return baseType.getTypeParameters()[ordinal]; }
/** * Returns <code>true</code> if the type is Collection<? extends Object> or * Map<? extends Object, ? extends Object>. */ private boolean isRawMapOrRawCollection(JClassType type) { if (type.asParameterizationOf(collectionClass) == collectionClass.asParameterizedByWildcards()) { return true; } if (type.asParameterizationOf(mapClass) == mapClass.asParameterizedByWildcards()) { return true; } return false; }
/** * Returns the method annotated with @UiFactory which returns the given type. * * @param forType the type to look for a factory of * @return the factory method, or null if none exists */ public JMethod getUiFactoryMethod(JClassType forType) { JGenericType genericType = forType.isGenericType(); if (genericType != null) { forType = genericType.getRawType(); } return uiFactories.get(forType); }
for ( JClassType parent : genericType.getFlattenedSupertypeHierarchy() ) { if ( parent.getQualifiedSourceName().equals( mappedClassType.getQualifiedSourceName() ) ) { parentClassType = parent; for ( JTypeParameter typeParameter : genericType.getTypeParameters() ) { JType arg = null; if ( null != parentClassType && null != parentClassType.isParameterized() ) { .equals( typeParameter.getName() ) ) { if ( null != mappedClassType.isGenericType() ) { arg = mappedClassType.isGenericType().getTypeParameters()[i]; } else { arg = mappedClassType.isParameterized().getTypeArgs()[i]; } else { ImmutableList.Builder<JType> builder = ImmutableList.builder(); for ( JTypeParameter typeParameter : genericType.getTypeParameters() ) { builder.add( typeParameter.getBaseType() );
@Override public String toString() { String parameterString = typeParameter.getName(); if (typeParameter.getDeclaringClass() != null) { parameterString += " of class " + typeParameter.getDeclaringClass().getQualifiedSourceName(); } return "'" + typeParameter.getFirstBound().getParameterizedQualifiedSourceName() + "' is reachable as an upper bound of type parameter " + parameterString + ", which appears in a root type"; } };
poison( "The %s parameterization %s is not assignable from the delegate" + " type %s", autoBeanInterface.getSimpleSourceName(), toWrap.getQualifiedSourceName()); continue;
@Override public String toString() { return "'" + typeArg.getParameterizedQualifiedSourceName() + "' is reachable from type argument " + typeArgIndex + " of type '" + baseType.getParameterizedQualifiedSourceName() + "'"; } };
@Override public String toString() { return getTypeParameter().getName() + " in " + baseType.getName(); }
protected void generateProxyMethods(SourceWriter w, SerializableTypeOracle serializableTypeOracle, TypeOracle typeOracle, Map<JMethod, JMethod> syncMethToAsyncMethMap) { JMethod[] syncMethods = serviceIntf.getOverridableMethods(); for (JMethod syncMethod : syncMethods) { JMethod asyncMethod = syncMethToAsyncMethMap.get(syncMethod); assert (asyncMethod != null); JClassType enclosingType = syncMethod.getEnclosingType(); JParameterizedType isParameterizedType = enclosingType.isParameterized(); if (isParameterizedType != null) { JMethod[] methods = isParameterizedType.getMethods(); for (int i = 0; i < methods.length; ++i) { if (methods[i] == syncMethod) { /* * Use the generic version of the method to ensure that the server * can find the method using the erasure of the generic signature. */ syncMethod = isParameterizedType.getBaseType().getMethods()[i]; } } } generateProxyMethod(w, serializableTypeOracle, typeOracle, syncMethod, asyncMethod); } }
@Override public String toString() { String parameterString = typeParameter.getName(); if (typeParameter.getDeclaringClass() != null) { parameterString += " of class " + typeParameter.getDeclaringClass().getQualifiedSourceName(); } return "'" + typeParameter.getFirstBound().getParameterizedQualifiedSourceName() + "' is reachable as an upper bound of type parameter " + parameterString + ", which appears in a root type"; } };
poison( "The %s parameterization %s is not assignable from the delegate" + " type %s", autoBeanInterface.getSimpleSourceName(), toWrap.getQualifiedSourceName()); continue;
@Override public String toString() { return "'" + typeArg.getParameterizedQualifiedSourceName() + "' is reachable from type argument " + typeArgIndex + " of type '" + baseType.getParameterizedQualifiedSourceName() + "'"; } };
@Override public String toString() { return getTypeParameter().getName() + " in " + baseType.getName(); }
protected void generateProxyMethods(SourceWriter w, SerializableTypeOracle serializableTypeOracle, TypeOracle typeOracle, Map<JMethod, JMethod> syncMethToAsyncMethMap) { JMethod[] syncMethods = serviceIntf.getOverridableMethods(); for (JMethod syncMethod : syncMethods) { JMethod asyncMethod = syncMethToAsyncMethMap.get(syncMethod); assert (asyncMethod != null); JClassType enclosingType = syncMethod.getEnclosingType(); JParameterizedType isParameterizedType = enclosingType.isParameterized(); if (isParameterizedType != null) { JMethod[] methods = isParameterizedType.getMethods(); for (int i = 0; i < methods.length; ++i) { if (methods[i] == syncMethod) { /* * Use the generic version of the method to ensure that the server * can find the method using the erasure of the generic signature. */ syncMethod = isParameterizedType.getBaseType().getMethods()[i]; } } } generateProxyMethod(w, serializableTypeOracle, typeOracle, syncMethod, asyncMethod); } }
JTypeParameter getTypeParameter() { return baseType.getTypeParameters()[ordinal]; }
/** * Returns <code>true</code> if the type is Collection<? extends Object> or * Map<? extends Object, ? extends Object>. */ private boolean isRawMapOrRawCollection(JClassType type) { if (type.asParameterizationOf(collectionClass) == collectionClass.asParameterizedByWildcards()) { return true; } if (type.asParameterizationOf(mapClass) == mapClass.asParameterizedByWildcards()) { return true; } return false; }
/** * Returns the method annotated with @UiFactory which returns the given type. * * @param forType the type to look for a factory of * @return the factory method, or null if none exists */ public JMethod getUiFactoryMethod(JClassType forType) { JGenericType genericType = forType.isGenericType(); if (genericType != null) { forType = genericType.getRawType(); } return uiFactories.get(forType); }
/** * Returns a simple types, including classes and * interfaces, parameterized, and raw types. Null is returned for other types * such as arrays and type parameters (e.g., 'E' in java.util.List<E>) because * filtering is meaningless for such types. */ protected String getBaseTypeName(JClassType type) { if(type == null){ return null; } if (type instanceof JRealClassType) { return type.getQualifiedSourceName(); } else if (type.isParameterized() != null) { return type.isParameterized().getBaseType().getQualifiedSourceName(); } else if (type.isRawType() != null) { return type.isRawType().getQualifiedSourceName(); } return type.getQualifiedSourceName(); }
poison( "The %s parameterization %s is not assignable from the delegate" + " type %s", autoBeanInterface.getSimpleSourceName(), toWrap.getQualifiedSourceName()); continue;
&& otherFlowInfo.isTransitivelyAffectedBy(flowInfoForArrayParam)) { problems.add(baseType, "Cannot serialize type '" + baseType.getParameterizedQualifiedSourceName() + "' when given an argument of type '" + typeArg.getParameterizedQualifiedSourceName() TreeLogger branch = logger.branch(TreeLogger.DEBUG, "Checking type argument " + paramIndex + " of type '" + baseType.getParameterizedQualifiedSourceName() + "' because it is directly exposed in this type or in one of its subtypes"); return computeTypeInstantiability(branch, typeArg, path, problems) + baseType.getParameterizedQualifiedSourceName() + "' because it is not exposed in this or any subtype"); return true; assert (exposure >= TypeParameterExposureComputer.EXPOSURE_MIN_BOUNDED_ARRAY); problems.add(getArrayType(typeOracle, exposure, typeArg), "Checking type argument " + paramIndex + " of type '" + baseType.getParameterizedQualifiedSourceName() + "' because it is exposed as an array with a maximum dimension of " + exposure + " in this type or one of its subtypes", Priority.AUXILIARY);