pb(varName + ".isAbstract = " + c.isAbstract() + ";"); if (c.isMemberType()) pb(varName + ".isMemberClass = true;"); if (c.isInterface() != null) pb(varName + ".isInterface = true;"); if (c.isAnnotation() != null) pb(varName + ".isAnnotation = true;");
pb(varName + ".isAbstract = " + c.isAbstract() + ";"); if (c.isMemberType()) pb(varName + ".isMemberClass = true;"); if (c.isInterface() != null) pb(varName + ".isInterface = true;"); if (c.isAnnotation() != null) pb(varName + ".isAnnotation = true;");
public static String getResourceName(JClassType targetClass) { String name = targetClass.getName(); if (targetClass.isMemberType()) { name = name.replace('.', '$'); } return name; }
public static String getResourceName(JClassType targetClass) { String name = targetClass.getName(); if (targetClass.isMemberType()) { name = name.replace('.', '$'); } return name; }
private void processClassArrayAnnotation(Class<?>[] classes, Collection<JClassType> accumulator) { for (Class<?> clazz : classes) { JClassType category = oracle.findType(clazz.getCanonicalName()); if (category == null) { poison("Could not find @%s type %s in the TypeOracle", Category.class.getSimpleName(), clazz.getCanonicalName()); continue; } else if (!category.isPublic()) { poison("Category type %s is not public", category.getQualifiedSourceName()); continue; } else if (!category.isStatic() && category.isMemberType()) { poison("Category type %s must be static", category.getQualifiedSourceName()); continue; } accumulator.add(category); } } }
private void processClassArrayAnnotation(Class<?>[] classes, Collection<JClassType> accumulator) { for (Class<?> clazz : classes) { JClassType category = oracle.findType(clazz.getCanonicalName()); if (category == null) { poison("Could not find @%s type %s in the TypeOracle", AutoBeanFactory.Category.class.getSimpleName(), clazz.getCanonicalName()); continue; } else if (!category.isPublic()) { poison("Category type %s is not public", category.getQualifiedSourceName()); continue; } else if (!category.isStatic() && category.isMemberType()) { poison("Category type %s must be static", category.getQualifiedSourceName()); continue; } accumulator.add(category); } } }
private void processClassArrayAnnotation(Class<?>[] classes, Collection<JClassType> accumulator) { for (Class<?> clazz : classes) { JClassType category = oracle.findType(clazz.getCanonicalName()); if (category == null) { poison("Could not find @%s type %s in the TypeOracle", Category.class.getSimpleName(), clazz.getCanonicalName()); continue; } else if (!category.isPublic()) { poison("Category type %s is not public", category.getQualifiedSourceName()); continue; } else if (!category.isStatic() && category.isMemberType()) { poison("Category type %s must be static", category.getQualifiedSourceName()); continue; } accumulator.add(category); } } }
/** * Returns <code>true</code> if a serializer class could access this type. */ private static boolean isAccessibleToSerializer(JClassType type) { if (type.isPrivate()) { return false; } if (isInStandardJavaPackage(type.getQualifiedSourceName())) { if (!type.isPublic()) { return false; } } if (type.isMemberType()) { return isAccessibleToSerializer(type.getEnclosingType()); } return true; }
/** * Returns <code>true</code> if a serializer class could access this type. */ private static boolean isAccessibleToSerializer(JClassType type) { if (type.isPrivate()) { return false; } if (isInStandardJavaPackage(type.getQualifiedSourceName())) { if (!type.isPublic()) { return false; } } if (type.isMemberType()) { return isAccessibleToSerializer(type.getEnclosingType()); } return true; }
/** * <p>filterSubtypesForDeserialization</p> * * @param logger a {@link com.google.gwt.core.ext.TreeLogger} object. * @param configuration a {@link com.github.nmorel.gwtjackson.rebind.RebindConfiguration} object. * @param type a {@link com.google.gwt.core.ext.typeinfo.JClassType} object. * @return a {@link com.google.gwt.thirdparty.guava.common.collect.ImmutableList} object. */ public static ImmutableList<JClassType> filterSubtypesForDeserialization( TreeLogger logger, RebindConfiguration configuration, JClassType type ) { boolean filterOnlySupportedType = isObjectOrSerializable( type ); ImmutableList.Builder<JClassType> builder = ImmutableList.builder(); if ( type.getSubtypes().length > 0 ) { for ( JClassType subtype : type.getSubtypes() ) { if ( (null == subtype.isInterface() && !subtype.isAbstract() && (!subtype.isMemberType() || subtype.isStatic())) && null == subtype.isAnnotation() && subtype.isPublic() && (!filterOnlySupportedType || (configuration.isTypeSupportedForDeserialization( logger, subtype ) // EnumSet and EnumMap are not supported in subtype deserialization because we can't know the enum to use. && !EnumSet.class.getCanonicalName().equals( subtype.getQualifiedSourceName() ) && !EnumMap.class.getCanonicalName().equals( subtype.getQualifiedSourceName() ))) && !findFirstEncounteredAnnotationsOnAllHierarchy( configuration, subtype.isClassOrInterface(), JsonIgnoreType.class, Optional.of( type ) ).isPresent() ) { builder.add( subtype ); } } } return builder.build(); }
if (type.isMemberType() && !type.isStatic()) {
if (type.isMemberType() && !type.isStatic()) {
pb(varName + ".isAbstract = " + c.isAbstract() + ";"); if (c.isMemberType()) pb(varName + ".isMemberClass = true;"); if (c.isInterface() != null) pb(varName + ".isInterface = true;"); if (c.isAnnotation() != null) pb(varName + ".isAnnotation = true;");
if (c.isEnum() != null) pb(varName + ".isEnum = true;"); if (c.isArray() != null) pb(varName + ".isArray = true;"); if (c.isMemberType()) pb(varName + ".isMemberClass = true;"); pb(varName + ".isStatic = " + c.isStatic() + ";"); pb(varName + ".isAbstract = " + c.isAbstract() + ";");