public AnnotationDecoration(System.Attribute ann, Net.Vpc.Upa.Config.DecorationSourceType locationType, Net.Vpc.Upa.Config.DecorationTarget targetType, string type, string location, int position, Net.Vpc.Upa.Config.ConfigInfo configInfo) { this.ann = ann; this.decorationSourceType = locationType; this.targetType = targetType; this.type = type; this.location = location; this.configInfo = configInfo; this.position = position; }
public SimpleDecoration(string name, Net.Vpc.Upa.Config.DecorationSourceType locationType, Net.Vpc.Upa.Config.DecorationTarget targetType, string type, string location, int position, Net.Vpc.Upa.Config.ConfigInfo configInfo, System.Collections.Generic.IDictionary <string, Net.Vpc.Upa.Config.DecorationValue> attr) { this.name = name; this.decorationSourceType = locationType; this.targetType = targetType; this.type = type; this.location = location; this.configInfo = configInfo; this.values = attr; this.position = position; }
protected internal override Net.Vpc.Upa.Config.ConfigInfo GetConfigInfo0() { if (configInfo == null) { Net.Vpc.Upa.Config.Decoration config = GetDecoration("config"); if (config != null) { Net.Vpc.Upa.Config.Decoration c = (Net.Vpc.Upa.Config.Decoration)config; if (c.GetName().Equals((typeof(Net.Vpc.Upa.Config.Config)).FullName)) { configInfo = new Net.Vpc.Upa.Config.ConfigInfo(c.GetInt("order"), (Net.Vpc.Upa.Config.ConfigAction)(System.Enum.Parse(typeof(Net.Vpc.Upa.Config.ConfigAction), c.GetString("action"))), c.GetString("persistenceGroup"), c.GetString("persistenceUnit")); } } } return(configInfo); }
public virtual void Merge() { System.Collections.Generic.Dictionary <string, Net.Vpc.Upa.Config.DecorationValue> att = new System.Collections.Generic.Dictionary <string, Net.Vpc.Upa.Config.DecorationValue>(); Net.Vpc.Upa.Config.DecorationValue[] alternatives1 = GetAlternatives(); Net.Vpc.Upa.Config.DecorationValue[] alternatives = Shrink(alternatives1); foreach (Net.Vpc.Upa.Config.DecorationValue alternative in alternatives) { Net.Vpc.Upa.Config.Decoration d = (Net.Vpc.Upa.Config.Decoration)alternative; foreach (System.Collections.Generic.KeyValuePair <string, Net.Vpc.Upa.Config.DecorationValue> e in new System.Collections.Generic.HashSet <System.Collections.Generic.KeyValuePair <string, Net.Vpc.Upa.Config.DecorationValue> >(d.GetAttributes())) { Net.Vpc.Upa.Impl.Config.Decorations.AbstractDecorationValue v1 = (Net.Vpc.Upa.Impl.Config.Decorations.AbstractDecorationValue)Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <string, Net.Vpc.Upa.Config.DecorationValue>(att, (e).Key); Net.Vpc.Upa.Impl.Config.Decorations.AbstractDecorationValue v2 = (Net.Vpc.Upa.Impl.Config.Decorations.AbstractDecorationValue)(e).Value; if (v1 == null) { att[(e).Key] = v2; } else { v1.AddAlternative(v2); } } break; } foreach (System.Collections.Generic.KeyValuePair <string, Net.Vpc.Upa.Config.DecorationValue> e in new System.Collections.Generic.HashSet <System.Collections.Generic.KeyValuePair <string, Net.Vpc.Upa.Config.DecorationValue> >(att)) { ((Net.Vpc.Upa.Impl.Config.Decorations.AbstractDecoration)(e).Value).Merge(); } if (alternatives.Length == 0) { Net.Vpc.Upa.Config.DecorationValue last = alternatives1[alternatives1.Length - 1]; mergedAttributes = new System.Collections.Generic.Dictionary <string, Net.Vpc.Upa.Config.DecorationValue>(); mergedConfigInfo = new Net.Vpc.Upa.Config.ConfigInfo(last.GetConfig().GetOrder(), Net.Vpc.Upa.Config.ConfigAction.DELETE, last.GetConfig().GetPersistenceGroup(), last.GetConfig().GetPersistenceUnit()); } else { Net.Vpc.Upa.Config.DecorationValue last = alternatives[alternatives.Length - 1]; mergedAttributes = att; mergedConfigInfo = new Net.Vpc.Upa.Config.ConfigInfo(last.GetConfig().GetOrder(), Net.Vpc.Upa.Config.ConfigAction.MERGE, last.GetConfig().GetPersistenceGroup(), last.GetConfig().GetPersistenceUnit()); } }
public virtual int CompareTo(Net.Vpc.Upa.Config.DecorationValue o) { if (o == null) { return(1); } if (o == this) { return(0); } Net.Vpc.Upa.Config.ConfigInfo c1 = this.GetConfig(); Net.Vpc.Upa.Config.ConfigInfo c2 = o.GetConfig(); if (c1 == c2) { return(0); } if (c1 != null) { return(c1.CompareTo(c2)); } return(0); }
public override Net.Vpc.Upa.Config.ConfigInfo GetConfig() { if (configInfo == null) { try { System.Reflection.MethodInfo method = ann.GetType().GetMethod("config"); if (method != null && ((method).ReturnType).FullName.Equals((typeof(Net.Vpc.Upa.Config.Config)).FullName)) { object t = method.Invoke(ann, new object[0]); Net.Vpc.Upa.Impl.Config.Decorations.AnnotationDecoration c = new Net.Vpc.Upa.Impl.Config.Decorations.AnnotationDecoration((System.Attribute)t, default(Net.Vpc.Upa.Config.DecorationSourceType), default(Net.Vpc.Upa.Config.DecorationTarget), null, null, 0); configInfo = new Net.Vpc.Upa.Config.ConfigInfo(c.GetInt("order"), (Net.Vpc.Upa.Config.ConfigAction)(System.Enum.Parse(typeof(Net.Vpc.Upa.Config.ConfigAction), c.GetString("action"))), c.GetString("persistenceGroup"), c.GetString("persistenceUnit")); } } catch (System.Exception e) { } } //ignore // e.printStackTrace(); if (configInfo == null) { configInfo = new Net.Vpc.Upa.Config.ConfigInfo(System.Int32.MinValue, Net.Vpc.Upa.Config.ConfigAction.MERGE, null, null); } return(configInfo); }
public virtual void Merge() { System.Collections.Generic.IList <object> ok = new System.Collections.Generic.List <object>(); Net.Vpc.Upa.Config.DecorationValue[] alternatives = GetAlternatives(); foreach (Net.Vpc.Upa.Config.DecorationValue alternative in alternatives) { Net.Vpc.Upa.Impl.Config.Decorations.DecorationPrimitiveValue d = (Net.Vpc.Upa.Impl.Config.Decorations.DecorationPrimitiveValue)alternative; switch (d.GetConfig().GetConfigAction()) { case Net.Vpc.Upa.Config.ConfigAction.DELETE: { ok.Clear(); break; } case Net.Vpc.Upa.Config.ConfigAction.MERGE: case Net.Vpc.Upa.Config.ConfigAction.REPLACE: { ok.Clear(); ok.Add(d.GetValue()); break; } } } Net.Vpc.Upa.Config.DecorationValue last = alternatives[alternatives.Length - 1]; if ((ok.Count == 0)) { @value = null; configInfo = new Net.Vpc.Upa.Config.ConfigInfo(last.GetConfig().GetOrder(), Net.Vpc.Upa.Config.ConfigAction.DELETE, last.GetConfig().GetPersistenceGroup(), last.GetConfig().GetPersistenceUnit()); } else { @value = ok[(ok).Count - 1]; configInfo = new Net.Vpc.Upa.Config.ConfigInfo(last.GetConfig().GetOrder(), Net.Vpc.Upa.Config.ConfigAction.MERGE, last.GetConfig().GetPersistenceGroup(), last.GetConfig().GetPersistenceUnit()); } }
public DecorationPrimitiveValue(object @value, Net.Vpc.Upa.Config.ConfigInfo configInfo) { this.@value = @value; this.configInfo = configInfo; }
public DecorationArray(Net.Vpc.Upa.Config.DecorationValue[] values, Net.Vpc.Upa.Config.ConfigInfo info) { this.values = values; this.configInfo = info; }