private void AddConfiguration(IClassHierarchy ns, ConfigurationBuilderImpl builder) { this.ClassHierarchy = this.ClassHierarchy.Merge(ns); //TODO //((ClassHierarchyImpl) ClassHierarchy).parameterParser // .mergeIn(((ClassHierarchyImpl) namespace).parameterParser); foreach (IClassNode cn in builder.BoundImpls.Keys) { IClassNode n = null; builder.BoundImpls.TryGetValue(cn, out n); if (n != null) { Bind(cn.GetFullName(), n.GetFullName()); } } foreach (IClassNode cn in builder.BoundConstructors.Keys) { IClassNode n = null; builder.BoundConstructors.TryGetValue(cn, out n); if (n != null) { Bind(cn.GetFullName(), n.GetFullName()); } } // The namedParameters set contains the strings that can be used to // instantiate new // named parameter instances. Create new ones where we can. foreach (INamedParameterNode np in builder.NamedParameters.Keys) { string v = null; builder.NamedParameters.TryGetValue(np, out v); Bind(np.GetFullName(), v); } foreach (IClassNode cn in builder.LegacyConstructors.Keys) { IConstructorDef cd = null; builder.LegacyConstructors.TryGetValue(cn, out cd); //RegisterLegacyConstructor(cn, cd.GetArgs()); TODO } //for (Entry<NamedParameterNode<Set<?>>, Object> e: builder.boundSetEntries) { // String name = ((NamedParameterNode<Set<T>>)(NamedParameterNode<?>)e.getKey()).getFullName(); // if(e.getValue() instanceof Node) { // bindSetEntry(name, (Node)e.getValue()); // } else if(e.getValue() instanceof String) { // bindSetEntry(name, (String)e.getValue()); // } else { // throw new IllegalStateException(); // } //} }
public ConfigurationBuilderImpl(ConfigurationBuilderImpl t) { this.ClassHierarchy = t.GetClassHierarchy(); try { AddConfiguration(t.GetClassHierarchy(), t); } catch (BindException e) { throw new IllegalStateException("Could not copy builder", e); } }
public ConfigurationBuilderImpl(ConfigurationBuilderImpl t) { this.ClassHierarchy = t.GetClassHierarchy(); try { AddConfiguration(t.GetClassHierarchy(), t); } catch (BindException e) { throw new IllegalStateException("Could not copy builder", e); } }
private void AddConfiguration(IClassHierarchy ns, ConfigurationBuilderImpl builder) { this.ClassHierarchy = this.ClassHierarchy.Merge(ns); //TODO //((ClassHierarchyImpl) ClassHierarchy).parameterParser // .mergeIn(((ClassHierarchyImpl) namespace).parameterParser); foreach (IClassNode cn in builder.BoundImpls.Keys) { IClassNode n = null; builder.BoundImpls.TryGetValue(cn, out n); if (n != null) { Bind(cn.GetFullName(), n.GetFullName()); } } foreach (IClassNode cn in builder.BoundConstructors.Keys) { IClassNode n = null; builder.BoundConstructors.TryGetValue(cn, out n); if (n != null) { Bind(cn.GetFullName(), n.GetFullName()); } } // The namedParameters set contains the strings that can be used to // instantiate new // named parameter instances. Create new ones where we can. foreach (INamedParameterNode np in builder.NamedParameters.Keys) { string v = null; builder.NamedParameters.TryGetValue(np, out v); Bind(np.GetFullName(), v); } foreach (IClassNode cn in builder.LegacyConstructors.Keys) { IConstructorDef cd = null; builder.LegacyConstructors.TryGetValue(cn, out cd); //RegisterLegacyConstructor(cn, cd.GetArgs()); TODO } //for (Entry<NamedParameterNode<Set<?>>, Object> e: builder.boundSetEntries) { // String name = ((NamedParameterNode<Set<T>>)(NamedParameterNode<?>)e.getKey()).getFullName(); // if(e.getValue() instanceof Node) { // bindSetEntry(name, (Node)e.getValue()); // } else if(e.getValue() instanceof String) { // bindSetEntry(name, (String)e.getValue()); // } else { // throw new IllegalStateException(); // } //} }
public ConfigurationImpl(ConfigurationBuilderImpl builder) { this.Builder = builder; }
public ConfigurationImpl(ConfigurationBuilderImpl builder) { this.Builder = builder; }