class Lutaml::ModelTransformations::FormatRegistry

def best_parser_for_file(file_path, use_content_detection: true)

Returns:
  • (Class, nil) - Best parser class for the file

Parameters:
  • use_content_detection (Boolean) -- Whether to use content detection
  • file_path (String) -- Path to the file
def best_parser_for_file(file_path, use_content_detection: true)
  # First try extension-based detection
  parser = parser_for_file(file_path)
  return parser if parser
  # Fall back to content detection if enabled
  if use_content_detection
    parser = detect_by_content(file_path)
    return parser if parser
  end
  nil
end