Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools

Java Types in JT 3.0

This file describes the representation of Java 5/6/7 types in JTransformer. With the exception of classT all PEFs explained below have been introduced in JTransformer 3.

Atomic Types

We use the term “atomic type” for every type that cannot be split further. In Java 5, only basic types (int, double, …) and class types are atomic:

Type Parameters

Java 5 introduces the concept of type parameters (and wildcards, which are just very special type parameters):

An inner class can access the type parameters of its outer class via:

Type References

Program element facts reference atomic types and type parameters uniformly via a type reference (typeRefT). Type references, array types and parameterized types are the root of a type subtree. They are represented by the following PEFs:

Most of the time, you do not need to deal with type references but can use the utility method

getType(Element, Type)

where Element is the ID of an AST node element and Type is the id of the PEF for the type of that element, that is the id of a

This utility method only works for elements that have a unique type. It does not work for generic types with many type paremeters, since it is not clear which one is meant.

See also

research/jtransformer/api/java/typesinjt3.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2020