private void orderAndConstructTypes() throws AtlasException { List<TraitType> traitTypes = new ArrayList<>(); for (String traitTypeName : traitNameToDefMap.keySet()) { traitTypes.add(getDataType(TraitType.class, traitTypeName)); } traitTypes = HierarchicalTypeDependencySorter.sortTypes(traitTypes); List<ClassType> classTypes = new ArrayList<>(); for (String classTypeName : classNameToDefMap.keySet()) { classTypes.add(getDataType(ClassType.class, classTypeName)); } classTypes = HierarchicalTypeDependencySorter.sortTypes(classTypes); for (StructTypeDefinition structDef : structDefs) { constructStructureType(structDef); } for (TraitType traitType : traitTypes) { constructHierarchicalType(TraitType.class, traitNameToDefMap.get(traitType.getName())); } for (ClassType classType : classTypes) { constructHierarchicalType(ClassType.class, classNameToDefMap.get(classType.getName())); } }
private void orderAndConstructTypes() throws AtlasException { List<TraitType> traitTypes = new ArrayList<>(); for (String traitTypeName : traitNameToDefMap.keySet()) { traitTypes.add(getDataType(TraitType.class, traitTypeName)); } traitTypes = HierarchicalTypeDependencySorter.sortTypes(traitTypes); List<ClassType> classTypes = new ArrayList<>(); for (String classTypeName : classNameToDefMap.keySet()) { classTypes.add(getDataType(ClassType.class, classTypeName)); } classTypes = HierarchicalTypeDependencySorter.sortTypes(classTypes); for (StructTypeDefinition structDef : structDefs) { constructStructureType(structDef); } for (TraitType traitType : traitTypes) { constructHierarchicalType(TraitType.class, traitNameToDefMap.get(traitType.getName())); } for (ClassType classType : classTypes) { constructHierarchicalType(ClassType.class, classNameToDefMap.get(classType.getName())); } }
@Override public IDataType getDataType(String name) throws AtlasException { if (transientTypes != null) { if (transientTypes.containsKey(name)) { return transientTypes.get(name); } /* * is this an Array Type? */ String arrElemType = TypeUtils.parseAsArrayType(name); if (arrElemType != null) { IDataType dT = defineArrayType(getDataType(IDataType.class, arrElemType)); return dT; } /* * is this a Map Type? */ String[] mapType = TypeUtils.parseAsMapType(name); if (mapType != null) { IDataType dT = defineMapType(getDataType(IDataType.class, mapType[0]), getDataType(IDataType.class, mapType[1])); return dT; } } return TypeSystem.this.getDataType(name); }
@Override public IDataType getDataType(String name) throws AtlasException { if (transientTypes != null) { if (transientTypes.containsKey(name)) { return transientTypes.get(name); } /* * is this an Array Type? */ String arrElemType = TypeUtils.parseAsArrayType(name); if (arrElemType != null) { IDataType dT = defineArrayType(getDataType(IDataType.class, arrElemType)); return dT; } /* * is this a Map Type? */ String[] mapType = TypeUtils.parseAsMapType(name); if (mapType != null) { IDataType dT = defineMapType(getDataType(IDataType.class, mapType[0]), getDataType(IDataType.class, mapType[1])); return dT; } } return TypeSystem.this.getDataType(name); }
private void validateAndSetupSuperTypes() throws AtlasException { for (HierarchicalTypeDefinition<TraitType> traitDef : traitDefs) { validateSuperTypes(TraitType.class, traitDef); TraitType traitType = getDataType(TraitType.class, traitDef.typeName); traitType.setupSuperTypesGraph(); } for (HierarchicalTypeDefinition<ClassType> classDef : classDefs) { validateSuperTypes(ClassType.class, classDef); ClassType classType = getDataType(ClassType.class, classDef.typeName); classType.setupSuperTypesGraph(); } }
private void validateAndSetupSuperTypes() throws AtlasException { for (HierarchicalTypeDefinition<TraitType> traitDef : traitDefs) { validateSuperTypes(TraitType.class, traitDef); TraitType traitType = getDataType(TraitType.class, traitDef.typeName); traitType.setupSuperTypesGraph(); } for (HierarchicalTypeDefinition<ClassType> classDef : classDefs) { validateSuperTypes(ClassType.class, classDef); ClassType classType = getDataType(ClassType.class, classDef.typeName); classType.setupSuperTypesGraph(); } }