@Test public void primitiveTypes() { start(new Callback() { @Override protected void test() { assertThat( target.convert((TypeMirror) types.getPrimitiveType(TypeKind.INT)), is(Models.toType(f, int.class))); assertThat( target.convert((TypeMirror) types.getPrimitiveType(TypeKind.LONG)), is(Models.toType(f, long.class))); assertThat( target.convert((TypeMirror) types.getPrimitiveType(TypeKind.FLOAT)), is(Models.toType(f, float.class))); assertThat( target.convert((TypeMirror) types.getPrimitiveType(TypeKind.DOUBLE)), is(Models.toType(f, double.class))); assertThat( target.convert((TypeMirror) types.getPrimitiveType(TypeKind.BYTE)), is(Models.toType(f, byte.class))); assertThat( target.convert((TypeMirror) types.getPrimitiveType(TypeKind.SHORT)), is(Models.toType(f, short.class))); assertThat( target.convert((TypeMirror) types.getPrimitiveType(TypeKind.CHAR)), is(Models.toType(f, char.class))); assertThat( target.convert((TypeMirror) types.getPrimitiveType(TypeKind.BOOLEAN)), is(Models.toType(f, boolean.class))); } }); }
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);  }