---
title: "Setting up Known External Types in Java"
---

LINQ Reporting Engine must be aware of custom external types that you reference in your template before the engine processes the template. You can set up external types known by the engine through the `ReportingEngine.getKnownTypes()` property. The property represents an unordered set (that is, a collection of unique items) of [Class](https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html) objects. Every type in the set must meet requirements declared at "Working with Types".

**Note** - `Object`, `String`, and primitive types are known by the engine by default.

Consider the following example. Given an `ImageUtil` class declared at your application and a template accessing a static member of this class, you can use the following code to make the engine be aware of the class before processing the template.
```java
ReportingEngine engine = new ReportingEngine();
engine.getKnownTypes().add(ImageUtil.class);
engine.buildReport(...);
```

------

## FAQ

1. **Q:** How do I register a custom Java class so that the LINQ Reporting Engine can use it in a template?
   **A:** Create an instance of `ReportingEngine`, then add the class object to the engine’s known‑types set via `engine.getKnownTypes().add(YourClass.class);`. After that, call `engine.buildReport(...)` to process the template.

2. **Q:** Which types are already known by the engine without any configuration?
   **A:** The engine automatically knows `Object`, `String`, and all Java primitive types (e.g., `int`, `double`, `boolean`) and their wrapper classes. No additional registration is required for these.

3. **Q:** Can I add several custom types at once?
   **A:** Yes. Call `engine.getKnownTypes().addAll(Arrays.asList(TypeA.class, TypeB.class, TypeC.class));` or add them individually in a loop before building the report.

4. **Q:** How can I remove a previously added type from the known‑types set?
   **A:** Use the `remove` method on the set: `engine.getKnownTypes().remove(UnwantedClass.class);`. This is useful if the class should no longer be accessible in templates.

5. **Q:** Do I need to register primitive wrapper classes (e.g., `Integer`, `Double`) manually?
   **A:** No. Primitive types and their corresponding wrapper classes are included by default, so you only need to register user‑defined classes or third‑party types.