use of org.camunda.bpm.model.xml.impl.type.attribute.AttributeImpl in project camunda-xml-model by camunda.
the class ElementReferenceCollectionBuilderImpl method performModelBuild.
@SuppressWarnings("unchecked")
public void performModelBuild(Model model) {
ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl) model.getType(referenceTargetClass);
ModelElementTypeImpl referenceSourceType = (ModelElementTypeImpl) model.getType(childElementType);
elementReferenceCollectionImpl.setReferenceTargetElementType(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.setReferenceTargetAttribute(idAttribute);
} else {
throw new ModelException("Unable to find id attribute of " + referenceTargetClass);
}
}
use of org.camunda.bpm.model.xml.impl.type.attribute.AttributeImpl in project camunda-xml-model by camunda.
the class AttributeReferenceBuilderImpl method performModelBuild.
@SuppressWarnings("unchecked")
public 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.setReferenceTargetElementType(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.setReferenceTargetAttribute(idAttribute);
} else {
throw new ModelException("Element type " + referenceTargetType.getTypeNamespace() + ":" + referenceTargetType.getTypeName() + " has no id attribute");
}
}
use of org.camunda.bpm.model.xml.impl.type.attribute.AttributeImpl in project camunda-xml-model by camunda.
the class AttributeReferenceCollectionBuilderImpl method performModelBuild.
@SuppressWarnings("unchecked")
public void performModelBuild(Model model) {
// register declaring type as a referencing type of referenced type
ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl) model.getType(referenceTargetElement);
// the actual referenced type
attributeReferenceCollection.setReferenceTargetElementType(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(attributeReferenceCollection);
attributeReferenceCollection.setReferenceTargetAttribute(idAttribute);
} else {
throw new ModelException("Element type " + referenceTargetType.getTypeNamespace() + ":" + referenceTargetType.getTypeName() + " has no id attribute");
}
}
Aggregations