private Structure getResourceDataType(final ResourceDefinition resource) { Structure _switchResult = null; boolean _matched = false; if (resource instanceof ServiceDataResource) { _matched=true; _switchResult = ((ServiceDataResource)resource).getDataType(); } return _switchResult; }
IScope scope_IncludedProperty_baseProperty(ServiceDataResource resourceDefinition, EReference eRef) { return getTypeFeatureScope(resourceDefinition.getDataType()); }
IScope scope_ObjectRealization_exclusivePropertyList(ServiceDataResource resourceDefinition, EReference eRef) { return getTypeFeatureScope(resourceDefinition.getDataType()); }
IScope scope_ObjectRealization_overriddenPropertyList(ServiceDataResource resourceDefinition, EReference eRef) { return getTypeFeatureScope(resourceDefinition.getDataType()); }
IScope scope_ObjectRealization_excludedProperties(ServiceDataResource resourceDefinition, EReference eRef) { return getTypeFeatureScope(resourceDefinition.getDataType()); }
private IScope getScopeForDataResource(ServiceDataResource dataResource) { Set<PrimitiveProperty> result = Sets.newLinkedHashSet(); if (dataResource != null && dataResource.getDataType() != null) { Structure structure = dataResource.getDataType(); result.addAll(getAllContentsOfType(structure, PrimitiveProperty.class)); result.addAll(getInheritedPrimitiveProperties(structure)); } return Scopes.scopeFor(result); }
public ResourceFinder(ResourceAPI resourceAPI) { if (resourceAPI == null) { return; } Iterable<ResourceDefinition> allDefinitions = Iterables.concat( RapidmlModelUtils.getImportedResources(RapidmlModelUtils.getZenModel(resourceAPI)), resourceAPI.getOwnedResourceDefinitions()); Iterable<ServiceDataResource> allServiceDataResources = Iterables.filter(allDefinitions, ServiceDataResource.class); for (ServiceDataResource serviceDataResource : allServiceDataResources) { Structure datatype = serviceDataResource.getDataType(); List<ServiceDataResource> resources = resourcesMap.get(datatype); if (resources == null) { resources = new ArrayList<ServiceDataResource>(); resourcesMap.put(datatype, resources); } resources.add(serviceDataResource); } }
private Structure getStructType(final TypedResponse response) { Structure _elvis = null; ResourceDefinition _resourceType = response.getResourceType(); Structure _dataType = null; if (((ServiceDataResource) _resourceType)!=null) { _dataType=((ServiceDataResource) _resourceType).getDataType(); } if (_dataType != null) { _elvis = _dataType; } else { Structure _dataType_1 = response.getDataType(); _elvis = _dataType_1; } return _elvis; }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public com.reprezen.rapidml.Structure getActualType() { Structure structure = getDataType(); if (structure == null && getResourceType() instanceof com.reprezen.rapidml.ServiceDataResource) { structure = ((com.reprezen.rapidml.ServiceDataResource) getResourceType()).getDataType(); } return structure; }
public static Structure getContextDataType(EObject context) { if (context instanceof ServiceDataResource) { return ((ServiceDataResource) context).getDataType(); } if (context instanceof TypedMessage) { return ((TypedMessage) context).getActualType(); } if (context instanceof ReferenceTreatment) { return ((ReferenceTreatment) context).getReferenceElement().getDataType(); } // not supported case return null; }
public static EList<Example> getAllExamples(TypedMessage message) { if (!message.getExamples().isEmpty()) { return message.getExamples(); } ResourceDefinition resource = message.getResourceType(); if (resource != null) { EList<Example> resourceExamples = resource.getExamples(); if (!resourceExamples.isEmpty()) { return resourceExamples; } if (resource instanceof ServiceDataResource) { Structure dataType = ((ServiceDataResource) resource).getDataType(); List<Example> result = new ArrayList<Example>(dataType.getDataExamples().size()); for (DataExample dataExample : dataType.getDataExamples()) { result.add(toExample(dataExample)); } return ECollections.asEList(result); } } return ECollections.emptyEList(); }
public String getMessageDocumentation(final TypedMessage message) { String result = this._zenModelHelper.getDocumentation(message); boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(result); if (_isNullOrEmpty) { Structure _xifexpression = null; Structure _actualType = message.getActualType(); boolean _tripleNotEquals = (_actualType != null); if (_tripleNotEquals) { _xifexpression = message.getActualType(); } else { Structure _xifexpression_1 = null; ResourceDefinition _resourceType = message.getResourceType(); if ((_resourceType instanceof ServiceDataResource)) { ResourceDefinition _resourceType_1 = message.getResourceType(); _xifexpression_1 = ((ServiceDataResource) _resourceType_1).getDataType(); } _xifexpression = _xifexpression_1; } final Structure dataType = _xifexpression; if ((dataType != null)) { result = this._zenModelHelper.getDocumentation(dataType); } } return result; }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public com.reprezen.rapidml.Structure getDataType() { if (eContainer() instanceof ServiceDataResource) { return ((ServiceDataResource) eContainer()).getDataType(); } if (eContainer() instanceof TypedMessage) { return ((TypedMessage) eContainer()).getActualType(); } if (eContainer() instanceof ReferenceRealization) { ReferenceRealization realization = (ReferenceRealization) eContainer(); ReferenceTreatment treatment = realization != null ? (ReferenceTreatment) realization.eContainer() : null; return treatment != null ? treatment.getReferenceElement().getDataType() : null; } if (eContainer() instanceof ReferenceTreatment) { return ((ReferenceTreatment) eContainer()).getReferenceElement().getDataType(); } return null; }
Structure _dataType = null; if (((ServiceDataResource) _resourceType)!=null) { _dataType=((ServiceDataResource) _resourceType).getDataType();
return Boolean.valueOf((!_hasReferenceTreatment)); }; Iterable<Feature> _filter = IterableExtensions.<Feature>filter(resource.getDataType().getOwnedFeatures(), _function); for(final Feature aFeature : _filter) {
return Boolean.valueOf(resource.isIncluded(e)); }; Iterable<PrimitiveProperty> _filter = IterableExtensions.<PrimitiveProperty>filter(Iterables.<PrimitiveProperty>filter(resource.getDataType().getOwnedFeatures(), PrimitiveProperty.class), _function); boolean _hasElements = false; for(final PrimitiveProperty feature : _filter) {
_builder.append(" "); _builder.append("\"name\": \""); String _name = aResource.getDataType().getName(); _builder.append(_name, " "); _builder.append("*\",");
_builder.newLineIfNotEmpty(); Structure _dataType = resource.getDataType(); boolean _tripleNotEquals = (_dataType != null); if (_tripleNotEquals) { _builder.append(" "); _builder.append("<span class=\"glyphicon glyphicon-arrow-right\"></span> <code>"); String _qualifiedName = this.importHelper.getQualifiedName(resource.getDataType()); _builder.append(_qualifiedName, " "); _builder.append("</code>");