@Test public void typeVariable() { start(new Callback() { @Override protected void test() { TypeElement map = elements.getTypeElement(Map.class.getName()); TypeParameterElement k = map.getTypeParameters().get(0); assertThat( target.convert(k.asType()), is((Type) f.newNamedType(f.newSimpleName("K")))); TypeElement list = elements.getTypeElement(List.class.getName()); TypeParameterElement e = list.getTypeParameters().get(0); assertThat( target.convert(e.asType()), is((Type) f.newNamedType(f.newSimpleName("E")))); } }); }
public PackageDeclaration convert(PackageElement packageElement) { if (packageElement == null) { throw new IllegalArgumentException( "packageElement must not be null"); } if (packageElement.isUnnamed()) { return null; } return factory.newPackageDeclaration( null, Collections.emptyList(), convert(packageElement.getQualifiedName())); }
Jsr269 { public PackageDeclaration convert(PackageElement packageElement) { if (packageElement == null) { throw new IllegalArgumentException( "packageElement must not be null"); } if (packageElement.isUnnamed()) { return null; } return factory.newPackageDeclaration( null, Collections.emptyList(), convert(packageElement.getQualifiedName())); } }
Jsr269 { public PackageDeclaration convert(PackageElement packageElement) { if (packageElement == null) { throw new IllegalArgumentException( "packageElement must not be null"); } if (packageElement.isUnnamed()) { return null; } return factory.newPackageDeclaration( null, Collections.emptyList(), convert(packageElement.getQualifiedName())); } Jsr269(ModelFactory factory); }
Jsr269 { public PackageDeclaration convert(PackageElement packageElement) { if (packageElement == null) { throw new IllegalArgumentException( "packageElement must not be null"); } if (packageElement.isUnnamed()) { return null; } return factory.newPackageDeclaration( null, Collections.emptyList(), convert(packageElement.getQualifiedName())); } Jsr269(ModelFactory factory); PackageDeclaration convert(PackageElement packageElement); Name convert(javax.lang.model.element.Name name); Type convert(TypeMirror type); ArrayType convert(javax.lang.model.type.ArrayType type); Type convert(DeclaredType type); Type convert(NoType type); BasicType convert(PrimitiveType type); NamedType convert(TypeVariable type); Wildcard convert(WildcardType type); List<ModifierKind> convert(Collection<javax.lang.model.element.Modifier> modifiers); void emit(Filer filer, CompilationUnit unit); void emit(Filer filer, CompilationUnit unit, Element... originatingElements); }
Jsr269 { public PackageDeclaration convert(PackageElement packageElement) { if (packageElement == null) { throw new IllegalArgumentException( "packageElement must not be null"); } if (packageElement.isUnnamed()) { return null; } return factory.newPackageDeclaration( null, Collections.emptyList(), convert(packageElement.getQualifiedName())); } Jsr269(ModelFactory factory); PackageDeclaration convert(PackageElement packageElement); Name convert(javax.lang.model.element.Name name); Type convert(TypeMirror type); ArrayType convert(javax.lang.model.type.ArrayType type); Type convert(DeclaredType type); Type convert(NoType type); BasicType convert(PrimitiveType type); NamedType convert(TypeVariable type); Wildcard convert(WildcardType type); List<ModifierKind> convert(Collection<javax.lang.model.element.Modifier> modifiers); void emit(Filer filer, CompilationUnit unit); void emit(Filer filer, CompilationUnit unit, Element... originatingElements);  }