private ClassBridgeMapping BuildClassBridge(IClassBridgeDefinition ann, Analyzer parentAnalyzer) { var classAnalyzer = GetAnalyzerByType(ann.Analyzer) ?? parentAnalyzer; return(new ClassBridgeMapping(ann.Name, BridgeFactory.ExtractType(ann)) { Boost = ann.Boost, Analyzer = classAnalyzer, Index = ann.Index, Store = ann.Store }); }
public static IFieldBridge ExtractType(IClassBridgeDefinition cb) { IFieldBridge bridge = null; if (cb != null) { System.Type impl = cb.Impl; if (impl != null) { try { object instance = Activator.CreateInstance(impl); if (instance is IFieldBridge) { bridge = (IFieldBridge) instance; } if (cb.Parameters.Count > 0 && instance is IParameterizedBridge) { // Already converted the parameters by this stage ((IParameterizedBridge) instance).SetParameterValues(cb.Parameters); } } catch (Exception e) { // TODO add classname throw new HibernateException("Unable to instantiate IFieldBridge for " + cb.Name, e); } } } // TODO add classname if (bridge == null) { throw new HibernateException("Unable to guess IFieldBridge "); } return bridge; }
public static IFieldBridge ExtractType(IClassBridgeDefinition cb) { IFieldBridge bridge = null; if (cb != null) { System.Type impl = cb.Impl; if (impl != null) { try { object instance = Activator.CreateInstance(impl); if (instance is IFieldBridge) { bridge = (IFieldBridge)instance; } if (cb.Parameters.Count > 0 && instance is IParameterizedBridge) { // Already converted the parameters by this stage ((IParameterizedBridge)instance).SetParameterValues(cb.Parameters); } } catch (Exception e) { // TODO add classname throw new HibernateException("Unable to instantiate IFieldBridge for " + cb.Name, e); } } } // TODO add classname if (bridge == null) { throw new HibernateException("Unable to guess IFieldBridge "); } return(bridge); }
private ClassBridgeMapping BuildClassBridge(IClassBridgeDefinition ann, Analyzer parentAnalyzer) { var classAnalyzer = GetAnalyzerByType(ann.Analyzer) ?? parentAnalyzer; return new ClassBridgeMapping(ann.Name, BridgeFactory.ExtractType(ann)) { Boost = ann.Boost, Analyzer = classAnalyzer, Index = ann.Index, Store = ann.Store }; }