sdx-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sdx-developers] QueryParser


From: Pierrick Brihaye
Subject: Re: [sdx-developers] QueryParser
Date: Mon, 19 Jan 2004 12:25:27 +0100
User-agent: Mozilla/5.0 (Windows; U; Win98; fr-FR; rv:1.0.2) Gecko/20030208 Netscape/7.02

Re,

Pierrick Brihaye a écrit:

Une idée sur le fait que je ne sois pas sur le bon QueryParser ?

A ce propos, cosmétique :

Dans LuceneIndex, on a :

private void configureQueryParser(Configuration configuration) throws ConfigurationException {
  //configuring the queryparser
Configuration qpConf = configuration.getChild(ELEMENT_NAME_QUERYPARSER, false);
  String qpClassName = DEFAULT_QUERYPARSER;
  if (qpConf != null)
   qpClassName = qpConf.getAttribute(ATTRIBUTE_CLASS, DEFAULT_QUERYPARSER);
  try {
    this.queryParserClass = Class.forName(qpClassName);
  } catch (ClassNotFoundException e) {
SDXException sdxE = new SDXException(logger, SDXExceptionCode.ERROR_CONFIGURE_QUERY_PARSER, null, e);
    throw new ConfigurationException(sdxE.getMessage(), sdxE);
  }
}

L'AnalyzerManager a un protocole beaucoup plus strict :

1) il cherche de l'info de configuration
2) crée une instance
3) vérifie qu'il implémente l'interface

Et donc, 3 types d'exceptions possibles :

InstantiationException
IllegalAccessException
ConfigurationException

Ne faudrait-il pas s'assurer que le QueryParser reswpecte le contrat ?

A+

--
Pierrick Brihaye, informaticien
Service régional de l'Inventaire
DRAC Bretagne
mailto:address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]