/** * Whether the given type is supported. * * @param type The type to test for supportability. * @return Whether the given type is supported. */ protected boolean isSupported(TypeMirror type) { if ((type instanceof Adaptable) && ((Adaptable) type).isAdapted()) { return isSupported(((Adaptable) type).getAdapterType().getAdaptingType()); } else if (type instanceof DeclaredType) { DecoratedDeclaredType declaredType = (DecoratedDeclaredType) TypeMirrorDecorator.decorate(type); if ((declaredType.getDeclaration() != null) && (isAMFTransient(declaredType.getDeclaration()))) { return false; } else if ((declaredType.isInstanceOf(Collection.class.getName())) || (declaredType.isInstanceOf(java.util.Map.class.getName()))) { boolean supported = true; for (TypeMirror typeArgument : declaredType.getActualTypeArguments()) { supported &= isSupported(typeArgument); } return supported; } else { return declaredType.getDeclaration() != null && !unsupportedTypes.contains(declaredType.getDeclaration().getQualifiedName()); } } //by default, we're going to assume that the type is complex and is supported. return true; }
public boolean isInstanceOf(String className) { if (super.isInstanceOf(className)) { return true; } DecoratedTypeDeclaration declaration = (DecoratedTypeDeclaration) getDeclaration(); if ((declaration != null) && (declaration.getQualifiedName().equals(className))) { return true; } else if (declaration == null) { return false; } Collection<InterfaceType> superinterfaces = declaration.getSuperinterfaces(); for (InterfaceType interfaceType : superinterfaces) { DecoratedInterfaceType decorated = (DecoratedInterfaceType) interfaceType; if (decorated.isInstanceOf(className)) { return true; } } return false; }
/** * Whether the given type is supported. * * @param type The type to test for supportability. * @return Whether the given type is supported. */ protected boolean isSupported(TypeMirror type) { if ((type instanceof Adaptable) && ((Adaptable) type).isAdapted()) { return isSupported(((Adaptable) type).getAdapterType().getAdaptingType()); } else if (type instanceof DeclaredType) { DecoratedDeclaredType declaredType = (DecoratedDeclaredType) TypeMirrorDecorator.decorate(type); if ((declaredType.getDeclaration() != null) && (isGWTTransient(declaredType.getDeclaration()))) { return false; } else if ((declaredType.isInstanceOf(Collection.class.getName())) || (declaredType.isInstanceOf(java.util.Map.class.getName()))) { boolean supported = true; for (TypeMirror typeArgument : declaredType.getActualTypeArguments()) { supported &= isSupported(typeArgument); } return supported; } else { return !unsupportedTypes.contains(declaredType.getDeclaration().getQualifiedName()); } } //by default, we're going to assume that the type is complex and is supported. return true; }
/** * Whether the given type is supported. * * @param type The type to test for supportability. * @return Whether the given type is supported. */ protected boolean isSupported(TypeMirror type) { if ((type instanceof Adaptable) && ((Adaptable) type).isAdapted()) { return isSupported(((Adaptable) type).getAdapterType().getAdaptingType()); } else if (type instanceof DeclaredType) { DecoratedDeclaredType declaredType = (DecoratedDeclaredType) TypeMirrorDecorator.decorate(type); if ((declaredType.getDeclaration() != null) && (isAMFTransient(declaredType.getDeclaration()))) { return false; } else if ((declaredType.isInstanceOf(Collection.class.getName())) || (declaredType.isInstanceOf(java.util.Map.class.getName()))) { boolean supported = true; for (TypeMirror typeArgument : declaredType.getActualTypeArguments()) { supported &= isSupported(typeArgument); } return supported; } else { return !unsupportedTypes.contains(declaredType.getDeclaration().getQualifiedName()); } } //by default, we're going to assume that the type is complex and is supported. return true; }
/** * Whether the given type is supported. * * @param type The type to test for supportability. * @return Whether the given type is supported. */ protected boolean isSupported(TypeMirror type) { if ((type instanceof Adaptable) && ((Adaptable) type).isAdapted()) { return isSupported(((Adaptable) type).getAdapterType().getAdaptingType()); } else if (type instanceof DeclaredType) { DecoratedDeclaredType declaredType = (DecoratedDeclaredType) TypeMirrorDecorator.decorate(type); if ((declaredType.getDeclaration() != null) && (isGWTTransient(declaredType.getDeclaration()))) { return false; } else if ((declaredType.isInstanceOf(Collection.class.getName())) || (declaredType.isInstanceOf(java.util.Map.class.getName()))) { boolean supported = true; for (TypeMirror typeArgument : declaredType.getActualTypeArguments()) { supported &= isSupported(typeArgument); } return supported; } else { return !unsupportedTypes.contains(declaredType.getDeclaration().getQualifiedName()); } } //by default, we're going to assume that the type is complex and is supported. return true; }