/** * If {@code xml-mapping-metadata-complete} is defined in PersistenceUnitMetadata, we create a new empty {@link Index} here. */ void mappingMetadataComplete() { LOG.debug( "xml-mapping-metadata-complete is specified in persistence-unit-metadata, ignore JPA annotations." ); index = Index.create( new HashMap<DotName, List<AnnotationInstance>>(), new HashMap<DotName, List<ClassInfo>>(), new HashMap<DotName, List<ClassInfo>>(), new HashMap<DotName, ClassInfo>() ); }
/** * If {@code xml-mapping-metadata-complete} is defined in PersistenceUnitMetadata, we create a new empty {@link Index} here. */ void mappingMetadataComplete() { LOG.debug( "xml-mapping-metadata-complete is specified in persistence-unit-metadata, ignore JPA annotations." ); index = Index.create( new HashMap<DotName, List<AnnotationInstance>>(), new HashMap<DotName, List<ClassInfo>>(), new HashMap<DotName, List<ClassInfo>>(), new HashMap<DotName, ClassInfo>() ); }
/** * Completes, finalizes, and returns the index after zero or more calls to * index. Future calls to index will result in a new index. * * @return the master index for all scanned class streams */ public Index complete() { initIndexMaps(); try { return Index.create(masterAnnotations, subclasses, implementors, classes); } finally { masterAnnotations = null; subclasses = null; classes = null; signatureParser = null; names = null; } }
private Index readClasses(PackedDataInputStream stream, int version) throws IOException { int entries = stream.readPackedU32(); HashMap<DotName, List<ClassInfo>> subclasses = new HashMap<DotName, List<ClassInfo>>(); HashMap<DotName, List<ClassInfo>> implementors = new HashMap<DotName, List<ClassInfo>>(); HashMap<DotName, ClassInfo> classes = new HashMap<DotName, ClassInfo>(); masterAnnotations = new HashMap<DotName, List<AnnotationInstance>>(); for (int i = 0; i < entries; i++) { DotName name = classTable[stream.readPackedU32()]; DotName superName = classTable[stream.readPackedU32()]; short flags = stream.readShort(); // No copyParameters supported in version 3+ boolean hasNoArgsConstructor = version >= 3 && stream.readBoolean(); int numIntfs = stream.readPackedU32(); List<Type> interfaces = new ArrayList<Type>(numIntfs); for (int j = 0; j < numIntfs; j++) { interfaces.add(new ClassType(classTable[stream.readPackedU32()])); } Type[] interfaceTypes = interfaces.toArray(new Type[interfaces.size()]); Map<DotName, List<AnnotationInstance>> annotations = new HashMap<DotName, List<AnnotationInstance>>(); Type superClassType = superName == null ? null : new ClassType(superName); ClassInfo clazz = new ClassInfo(name, superClassType, flags, interfaceTypes, annotations, hasNoArgsConstructor); classes.put(name, clazz); addClassToMap(subclasses, superName, clazz); for (Type interfaceName : interfaces) { addClassToMap(implementors, interfaceName.name(), clazz); } readAnnotations(stream, annotations, clazz); } return Index.create(masterAnnotations, subclasses, implementors, classes); }
return Index.create( annotations, subclasses, implementors, classes );
return Index.create( annotations, subclasses, implementors, classes );