---
title: 'Fluent Interface-based API für Java Reflection: FEST-Reflect'
url: 'https://tutego.de/blog/javainsel/2009/02/fluent-interface-based-api-fur-java-reflection-fest-reflect'
markdown: 'https://tutego.de/blog/javainsel/2009/02/fluent-interface-based-api-fur-java-reflection-fest-reflect.md'
date: '2009-02-28'
description: 'FEST-Reflect is a Java library that provides a Fluent Interface-based API that simplifies the usage of Java Reflection, resulting in improved readability and type safety. It supports class loading, access to static inner classes constructors, methods and fields, and more! Die Aufrufen sind dann h…'
taxonomy:
  category:
    - 'Open Source'
---

# Fluent Interface-based API für Java Reflection: FEST-Reflect

![Illustration einer tropischen Insel mit Palmen und einem hohen Berg](https://tutego.de/blog/javainsel/user/themes/tutego/images/insel-cover.jpg)# Java Blog für Programmierer

[Java Blog für Programmierer](https://tutego.de/blog/javainsel/)

## Fluent Interface-based API für Java Reflection: FEST-Reflect

28.02.2009 · [Christian Ullenboom](https://tutego.de/blog/javainsel/author/admin/)

> [FEST-Reflect](http://fest.easytesting.org/reflect/index.html) is a Java library that provides a [Fluent Interface](http://martinfowler.com/bliki/FluentInterface.html)-based API that simplifies the usage of [Java Reflection](http://java.sun.com/docs/books/tutorial/reflect/), resulting in improved readability and type safety. It supports class loading, access to static inner classes constructors, methods and fields, and more!

Die Aufrufen sind dann hübsch kompakt:

Steht zur Compilezeit etwa

```java
  String name = names.get(8);
```

wird mit [FEST-Reflect](http://fest.easytesting.org/reflect/index.html) daraus

```java
  String name = method("get").withReturnType(String.class)                             .withParameterTypes(int.class)                             .in(names)                             .invoke(8);
```

Ein paar weitere Beispiele:

```java
  Person person = constructor().withParameterTypes(String.class)                               .in(Person.class)                               .newInstance("Yoda");  method("setName").withParameterTypes(String.class)                   .in(person)                   .invoke("Luke");  field("name").ofType(String.class)               .in(person)               .set("Anakin");  List powers = field("powers").ofType(new TypeRef() {})                                       .in(jedi)                                       .get();
```

Kategorien: [Open Source](https://tutego.de/blog/javainsel/category/open-source/)

## 1 Kommentare

**Gastbeitrag: SQL als "interne DSL" in Java mit jOOQ** · [12.07.2011 18:33](#comment-3623)

\\\[...\\\] Reflection API: http://www.tutego.de/blog/javainsel/2009/02/fluent-interface-based-api-fur-java-reflection-fest-refl... \\\[...\\\]

Die bisherigen Kommentare wurden aus WordPress übernommen. Neue Kommentare sind derzeit geschlossen.

[← Alle Beiträge](https://tutego.de/blog/javainsel/)

---

## Navigation

- Previous: [Ehrlicher Kommentar: "Swing 2: Pissing in the Wind"](https://tutego.de/blog/javainsel/2009/02/ehrlicher-kommentar-swing-2-pissing-in-the-wind.md)
- Next: [Alphanum Algorithm](https://tutego.de/blog/javainsel/2009/02/alphanum-algorithm.md)
