public Map<String, AnnotationType> getAnnotationTypes() { return handler.getDocumentTypeManager().getAnnotationTypeRegistry().getTypes(); }
private static void addAnnotationTypeInheritance(DocumentmanagerConfig config, DocumentTypeManager manager) { for (DocumentmanagerConfig.Annotationtype annType : config.annotationtype()) { if (annType.inherits().size() > 0) { AnnotationType inheritedType = manager.getAnnotationTypeRegistry().getType(annType.inherits(0).id()); AnnotationType type = manager.getAnnotationTypeRegistry().getType(annType.id()); type.inherit(inheritedType); } } }
private static void setupAnnotationTypesWithoutPayloads(DocumentmanagerConfig config, DocumentTypeManager manager) { for (DocumentmanagerConfig.Annotationtype annType : config.annotationtype()) { AnnotationType annotationType = new AnnotationType(annType.name(), annType.id()); manager.getAnnotationTypeRegistry().register(annotationType); } }
private static void setupAnnotationRefTypes(DocumentmanagerConfig config, DocumentTypeManager manager) { for (int i = 0; i < config.datatype().size(); i++) { DocumentmanagerConfig.Datatype thisDataType = config.datatype(i); int id = thisDataType.id(); for (Object o : thisDataType.annotationreftype()) { DocumentmanagerConfig.Datatype.Annotationreftype annRefType = (DocumentmanagerConfig.Datatype.Annotationreftype) o; AnnotationType annotationType = manager.getAnnotationTypeRegistry().getType(annRefType.annotation()); if (annotationType == null) { throw new IllegalArgumentException("Found reference to " + annRefType.annotation() + ", which does not exist!"); } AnnotationReferenceDataType type = new AnnotationReferenceDataType(annotationType, id); manager.register(type); } } }
private static void addAnnotationTypePayloads(DocumentmanagerConfig config, DocumentTypeManager manager) { for (DocumentmanagerConfig.Annotationtype annType : config.annotationtype()) { AnnotationType annotationType = manager.getAnnotationTypeRegistry().getType(annType.id()); DataType payload = manager.getDataType(annType.datatype(), ""); if (!payload.equals(DataType.NONE)) { annotationType.setDataType(payload); } } }
public void read(Annotation annotation) { int annotationTypeId = buf.getInt(); AnnotationType type = manager.getAnnotationTypeRegistry().getType(annotationTypeId);
public void read(Annotation annotation) { int annotationTypeId = buf.getInt(); AnnotationType type = manager.getAnnotationTypeRegistry().getType(annotationTypeId);