Search in sources :

Example 6 with TSSource

use of io.crnk.gen.typescript.model.TSSource in project crnk-framework by crnk-project.

the class TSImportProcessor method processType.

private static void processType(TSSource source, TSNamedElement type) {
    TSSource refSource = getSource(type);
    // no need for inclusions of primitive types and within same file
    if (!(type instanceof TSPrimitiveType || source == refSource)) {
        TSNamedElement importedType = type;
        if (type.getParent() instanceof TSModule) {
            importedType = (TSNamedElement) type.getParent();
        }
        addImport(refSource, source, importedType);
    }
}
Also used : TSPrimitiveType(io.crnk.gen.typescript.model.TSPrimitiveType) TSModule(io.crnk.gen.typescript.model.TSModule) TSSource(io.crnk.gen.typescript.model.TSSource) TSNamedElement(io.crnk.gen.typescript.model.TSNamedElement)

Aggregations

TSSource (io.crnk.gen.typescript.model.TSSource)6 TSModule (io.crnk.gen.typescript.model.TSModule)2 TSContainerElement (io.crnk.gen.typescript.model.TSContainerElement)1 TSEnumLiteral (io.crnk.gen.typescript.model.TSEnumLiteral)1 TSEnumType (io.crnk.gen.typescript.model.TSEnumType)1 TSExport (io.crnk.gen.typescript.model.TSExport)1 TSNamedElement (io.crnk.gen.typescript.model.TSNamedElement)1 TSPrimitiveType (io.crnk.gen.typescript.model.TSPrimitiveType)1 TSType (io.crnk.gen.typescript.model.TSType)1 TSWriter (io.crnk.gen.typescript.writer.TSWriter)1 MetaElement (io.crnk.meta.model.MetaElement)1 MetaEnumType (io.crnk.meta.model.MetaEnumType)1 MetaResource (io.crnk.meta.model.resource.MetaResource)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1