SDA SE Wiki

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

User Tools

Site Tools



preserve_qualifiedNameT(#id, #type, 'kind', [#headType1, ...])

This fact is used for preserving the original appearance of the source code after transformations. It declares, that the type name should be qualified. It can be either fully qualified or partially qualified (in case of using inner classes).

java.lang.String s;

instead of

String s;
History
  • JTransformer 3.0: Added as srcQualifiedT
  • JTransformer 4.0: Renamed to preserve_qualifiedNameT

Arguments

id: id
ID of the corresponding element
type: Type reference
The corresponding type (can differ from element type in case of parameterized types)
kind: full | partial
Either full (for fully qualified names) or partial (for partially qualified names)
headType: packageT, classT, null
List of elements of the qualified name (or null in case of fully qualified name)

Sample Java Source

java.lang.String s;           // fully qualified

Its PEF Representation

fieldT(#Field, ..., #String, 's', null).
preserve_qualifiedNameT(#Field, #String, full, null).

Advanced Sample Java Source

InnerClass.InnerInnerClass c1;                              // partially qualified
...
preserve.QualifiedName.InnerClass.InnerInnerClass c2;       // fully qualified

Its PEF Representation

fieldT(#Field1, ..., #InnerInnerClass, 'c1', null).
preserve_qualifiedNameT(#Field1, #InnerInnerClass, partial, [#InnerInnerClass, #InnerClass]).
...
fieldT(#Field2, ..., #InnerInnerClass, 'c2', null).
preserve_qualifiedNameT(#Field2, #InnerInnerClass, full, null).

AST Specification

ast_relation_type_spec(preserve_qualifiedNameT,[
    ast_arg(id,       mult(1,1,no ), id,   [id]),
    ast_arg(type,     mult(1,1,no ), id,   [type_inst]),
    ast_arg(kind,     mult(1,1,no ), attr, [atomic]),
    ast_arg(headType, mult(0,*,no ), id,   [packageT, classT, nullType])
]).
research/jtransformer/api/java/pefs/4.0/preserve_qualifiednamet.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019