/** * Creates a new type where the numeric ID is based on the hash of targetType */ public static ReferenceDataType createWithInferredId(TemporaryStructuredDataType targetType) { return new ReferenceDataType(targetType); }
/** * Creates a new type where the numeric ID is based on the hash of targetType */ public static ReferenceDataType createWithInferredId(DocumentType targetType) { return new ReferenceDataType(targetType); }
private static void registerReferenceType(DocumentTypeManager manager, int id, DocumentmanagerConfig.Datatype.Referencetype refType) { ReferenceDataType referenceType; if (manager.hasDataType(refType.target_type_id())) { DocumentType targetDocType = (DocumentType)manager.getDataType(refType.target_type_id()); referenceType = new ReferenceDataType(targetDocType, id); } else { TemporaryStructuredDataType temporaryTargetType = TemporaryStructuredDataType.createById(refType.target_type_id()); referenceType = new ReferenceDataType(temporaryTargetType, id); } // Note: can't combine the above new-statements, as they call different constructors. manager.register(referenceType); }