/// <summary> /// Calculate a collection of all base types for the given type /// </summary> public static ICollection <ModelElementType> calculateAllBaseTypes(ModelElementType type) { IList <ModelElementType> baseTypes = new List <ModelElementType>(); ModelElementTypeImpl typeImpl = (ModelElementTypeImpl)type; typeImpl.resolveBaseTypes(baseTypes); return(baseTypes); }
/// <summary> /// Calculate a collection of all extending types for the given base types /// </summary> /// <param name="baseTypes"> the collection of types to calculate the union of all extending types </param> public static ICollection <ModelElementType> calculateAllExtendingTypes(Model model, ICollection <ModelElementType> baseTypes) { ISet <ModelElementType> allExtendingTypes = new HashSet <ModelElementType>(); foreach (ModelElementType baseType in baseTypes) { ModelElementTypeImpl modelElementTypeImpl = (ModelElementTypeImpl)model.getType(baseType.InstanceType); modelElementTypeImpl.resolveExtendingTypes(allExtendingTypes); } return(allExtendingTypes); }
/// <summary> /// Returns the <seealso cref="ModelElementInstanceImpl ModelElement"/> for a DOM element. /// If the model element does not yet exist, it is created and linked to the DOM. /// </summary> /// <param name="domElement"> the child element to create a new <seealso cref="ModelElementInstanceImpl ModelElement"/> for </param> /// <returns> the child model element </returns> public static ModelElementInstance getModelElement(DomElement domElement, ModelInstanceImpl modelInstance) { ModelElementInstance modelElement = domElement.ModelElementInstance; if (modelElement == null) { ModelElementTypeImpl modelType = getModelElement(domElement, modelInstance, domElement.NamespaceURI); modelElement = modelType.newInstance(modelInstance, domElement); domElement.ModelElementInstance = modelElement; } return(modelElement); }
public virtual void buildTypeHierarchy(Model model) { // build type hierarchy if (extendedType != null) { ModelElementTypeImpl extendedModelElementType = (ModelElementTypeImpl)model.getType(extendedType); if (extendedModelElementType == null) { throw new ModelException("Type " + modelType + " is defined to extend " + extendedType + " but no such type is defined."); } else { modelType.setBaseType(extendedModelElementType); extendedModelElementType.registerExtendingType(modelType); } } }
protected internal static ModelElementTypeImpl getModelElement(DomElement domElement, ModelInstanceImpl modelInstance, string namespaceUri) { string localName = domElement.LocalName; ModelElementTypeImpl modelType = (ModelElementTypeImpl)modelInstance.Model.getTypeForName(namespaceUri, localName); if (modelType == null) { Model model = modelInstance.Model; string actualNamespaceUri = model.getActualNamespace(namespaceUri); if (!string.ReferenceEquals(actualNamespaceUri, null)) { modelType = getModelElement(domElement, modelInstance, actualNamespaceUri); } else { modelType = (ModelElementTypeImpl)modelInstance.registerGenericType(namespaceUri, localName); } } return(modelType); }
public virtual void PerformModelBuild(IModel model) { ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl)model.GetType(typeof(TTarget)); ModelElementTypeImpl referenceSourceType = (ModelElementTypeImpl)model.GetType(typeof(TSource)); ElementReferenceCollectionImpl.ReferenceTargetElementType = referenceTargetType; ElementReferenceCollectionImpl.SetReferenceSourceElementType(referenceSourceType); // the referenced attribute may be declared on a base type of the referenced type. AttributeImpl idAttribute = (AttributeImpl)referenceTargetType.GetAttribute("id"); if (idAttribute != null) { idAttribute.RegisterIncoming(ElementReferenceCollectionImpl); ElementReferenceCollectionImpl.ReferenceTargetAttribute = idAttribute; } else { throw new ModelException("Unable to find id attribute of " + typeof(TTarget)); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public void performModelBuild(org.camunda.bpm.model.xml.Model model) public virtual void performModelBuild(Model model) { ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl)model.getType(referenceTargetClass); ModelElementTypeImpl referenceSourceType = (ModelElementTypeImpl)model.getType(childElementType); elementReferenceCollectionImpl.ReferenceTargetElementType = referenceTargetType; elementReferenceCollectionImpl.setReferenceSourceElementType(referenceSourceType); // the referenced attribute may be declared on a base type of the referenced type. AttributeImpl <string> idAttribute = (AttributeImpl <string>)referenceTargetType.getAttribute("id"); if (idAttribute != null) { idAttribute.registerIncoming(elementReferenceCollectionImpl); elementReferenceCollectionImpl.ReferenceTargetAttribute = idAttribute; } else { throw new ModelException("Unable to find id attribute of " + referenceTargetClass); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public void performModelBuild(org.camunda.bpm.model.xml.Model model) public virtual void performModelBuild(Model model) { // register declaring type as a referencing type of referenced type ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl)model.getType(referenceTargetElement); // the actual referenced type attributeReferenceImpl.ReferenceTargetElementType = referenceTargetType; // the referenced attribute may be declared on a base type of the referenced type. AttributeImpl <string> idAttribute = (AttributeImpl <string>)referenceTargetType.getAttribute("id"); if (idAttribute != null) { idAttribute.registerIncoming(attributeReferenceImpl); attributeReferenceImpl.ReferenceTargetAttribute = idAttribute; } else { throw new ModelException("Element type " + referenceTargetType.TypeNamespace + ":" + referenceTargetType.TypeName + " has no id attribute"); } }
public SequenceBuilderImpl(ModelElementTypeImpl modelType) { this._elementType = modelType; }
public ChildElementCollectionImpl(Type childElementTypeClass, ModelElementTypeImpl parentElementType) { childElementTypeClass = typeof(T); this.childElementTypeClass = childElementTypeClass; this.parentElementType = parentElementType; }
public ChildElementImpl(ModelElementTypeImpl parentElementType) : base(parentElementType) { this.maxOccurs = 1; }
public StringAttributeBuilderImpl(string attributeName, ModelElementTypeImpl modelType) : base(attributeName, modelType, new StringAttribute(modelType)) { }
public virtual ChildElementAssert assertThatChildElement(ModelElementType childElementType) { ModelElementTypeImpl modelElementTypeImpl = (ModelElementTypeImpl)modelElementType; return(assertThat(modelElementTypeImpl.getChildElementCollection(childElementType))); }
public IntegerAttributeBuilder(string attributeName, ModelElementTypeImpl modelType) : base(attributeName, modelType, new IntegerAttribute(modelType)) { }
public ModelElementTypeBuilderImpl(Type instanceType, string name, ModelImpl model) { this.instanceType = instanceType; this.model = model; modelType = new ModelElementTypeImpl(model, name, instanceType); }
public ModelTypeInstanceContext(IDomElement domElement, IModelInstance model, ModelElementTypeImpl modelType) { this._domElement = domElement; this._model = model; this._modelType = modelType; }
public NamedEnumAttributeBuilder(string attributeName, ModelElementTypeImpl modelType, Type type) { type = typeof(T); base(attributeName, modelType, new NamedEnumAttribute <T>(modelType, type)); }
public NamedEnumAttributeBuilder(string attributeName, ModelElementTypeImpl modelType) : base(attributeName, modelType, new NamedEnumAttribute <T>(modelType)) { }
public ChildElementImpl(Type childElementTypeChild, ModelElementTypeImpl parentElementType) { childElementTypeChild = typeof(T); base(childElementTypeChild, parentElementType); this.maxOccurs = 1; }
public ChildElementCollectionImpl(ModelElementTypeImpl parentElementType) { //this.childElementTypeClass = childElementTypeClass; this._parentElementType = parentElementType; }
public ModelElementInstanceImpl(ModelTypeInstanceContext instanceContext) { this.domElement = instanceContext.DomElement; this.modelInstance = instanceContext.Model; this.elementType = instanceContext.ModelType; }
public DoubleAttributeBuilder(string attributeName, ModelElementTypeImpl modelType) : base(attributeName, modelType, new DoubleAttribute((modelType))) { }
public BooleanAttributeBuilder(string attributeName, ModelElementTypeImpl modelType) : base(attributeName, modelType, new BooleanAttribute(modelType)) { }
public virtual void setReferenceSourceElementType(ModelElementTypeImpl referenceSourceType) { this.referenceSourceType = referenceSourceType; }
internal AttributeBuilderImpl(string attributeName, ModelElementTypeImpl modelType, AttributeImpl /*<T>*/ attribute) { this._modelType = modelType; this._attribute = attribute; attribute.AttributeName = attributeName; }
public ChildElementCollectionBuilderImpl(IModelElementType parentElementType) { this.parentElementType = (ModelElementTypeImpl)parentElementType; this._collection = CreateCollectionInstance(); }