private static void handleUnknownData(EObject object, AnyType unknownData, LoadHandler handler) { handleUnknownFeatures(object, unknownData.getMixed(), handler); handleUnknownFeatures(object, unknownData.getAnyAttribute(), handler); }
@Override public Object caseDuration(Duration duration) { AnyType extension = getExtension(resource, duration); if (extension != null) { Boolean isFirstEvent = Boolean.valueOf(!"false" //$NON-NLS-1$ .equals(getValue(extension.getAnyAttribute(), "isFirstTime", true))); //$NON-NLS-1$ Collection<EObject> eObjects = getEObjects(extension, resource, "event", true); //$NON-NLS-1$ if (!eObjects.isEmpty()) { DurationObservation durationObservation = (DurationObservation) duration .getNearestPackage().createPackagedElement( duration.getName(), UMLPackage.Literals.DURATION_OBSERVATION); EList<NamedElement> events = durationObservation .getEvents(); EList<Boolean> firstEvents = durationObservation .getFirstEvents(); for (EObject eObject : eObjects) { if (eObject instanceof NamedElement) { events.add((NamedElement) eObject); firstEvents.add(isFirstEvent); } } duration.getObservations().add(durationObservation); } } return super.caseDuration(duration); }
mixedTargets.push(anyType.getMixed()); text = new StringBuffer();
protected void recordUnknownFeature(String prefix, String name, boolean isElement, EObject peekObject, String value) { if (isElement) { AnyType anyType = getExtension(peekObject); int objectsIndex = objects.size(); objects.push(anyType); int mixedTargetsIndex = mixedTargets.size(); mixedTargets.push(anyType.getAny()); int typesIndex = types.size(); types.push(UNKNOWN_FEATURE_TYPE); handleFeature(prefix, name); objects.remove(objectsIndex); mixedTargets.remove(mixedTargetsIndex); types.remove(typesIndex); } else { AnyType anyType = getExtension(peekObject); setAttribValue(anyType, prefix == null ? name : prefix + ":" + name, value); } }
if (root instanceof AnyType) for (FeatureMap.Entry entry : ((AnyType)root).getAnyAttribute())
mixedTargets.push(anyType.getMixed()); text = new StringBuffer();
protected void recordUnknownFeature(String prefix, String name, boolean isElement, EObject peekObject, String value) { if (isElement) { AnyType anyType = getExtension(peekObject); int objectsIndex = objects.size(); objects.push(anyType); int mixedTargetsIndex = mixedTargets.size(); mixedTargets.push(anyType.getAny()); int typesIndex = types.size(); types.push(UNKNOWN_FEATURE_TYPE); handleFeature(prefix, name); objects.remove(objectsIndex); mixedTargets.remove(mixedTargetsIndex); types.remove(typesIndex); } else { AnyType anyType = getExtension(peekObject); setAttribValue(anyType, prefix == null ? name : prefix + ":" + name, value); } }
private static String getText(FeatureMap root, String id) { Stack<FeatureMap> stack = new Stack<FeatureMap>(); stack.push(root); while (!stack.isEmpty()) { FeatureMap featureMap = stack.pop(); for (FeatureMap.Entry entry : featureMap) { if (entry.getEStructuralFeature() instanceof EReference) { AnyType anyType = (AnyType) entry.getValue(); String attributeValue = getAttributeValue(anyType.getAnyAttribute(), "ID"); if (attributeValue != null && attributeValue.equals(id)) { return getText(anyType.getMixed()); } stack.push(anyType.getMixed()); } } } return null; }
if (root instanceof AnyType) for (FeatureMap.Entry entry : ((AnyType)root).getAnyAttribute())
mixedTargets.push(anyType.getMixed()); text = new StringBuffer();
EStructuralFeature entryFeature = extendedMetaData.demandFeature(extendedMetaData.getNamespace(feature), extendedMetaData.getName(feature), true); anyType.getAny().add(entryFeature, newObject); contextFeature = entryFeature; EStructuralFeature entryFeature = extendedMetaData.demandFeature(extendedMetaData.getNamespace(feature), extendedMetaData.getName(feature), true); anyType.getAny().add(entryFeature, result); contextFeature = entryFeature;
private EObject getEObject(AnyType extension, Resource resource, String name, boolean remove) { if (extension != null) { Object value = getValue(extension.getAnyAttribute(), name, remove); if (value == null) { value = getValue(extension.getMixed(), name, remove); if (value instanceof EObject) { return (EObject) value; } } else if (value instanceof String && resource != null) { return resource.getEObject((String) value); } } return null; }
Object value = getValue(extension.getAnyAttribute(), "body", true); //$NON-NLS-1$ value = getValue(extension.getAnyAttribute(), "symbol", true); //$NON-NLS-1$
mixedTargets.push(anyType.getMixed()); text = new StringBuffer();
EStructuralFeature entryFeature = extendedMetaData.demandFeature(extendedMetaData.getNamespace(feature), extendedMetaData.getName(feature), true); anyType.getAny().add(entryFeature, newObject); contextFeature = entryFeature; EStructuralFeature entryFeature = extendedMetaData.demandFeature(extendedMetaData.getNamespace(feature), extendedMetaData.getName(feature), true); anyType.getAny().add(entryFeature, result); contextFeature = entryFeature;
private EObject getEObject(AnyType extension, Resource resource, String name, boolean remove) { if (extension != null) { Object value = getValue(extension.getAnyAttribute(), name, remove); if (value == null) { value = getValue(extension.getMixed(), name, remove); if (value instanceof EObject) { return (EObject) value; } } else if (value instanceof String && resource != null) { return resource.getEObject((String) value); } } return null; }
@Override public Object caseAction(Action action) { AnyType extension = getExtension(resource, action); if (extension != null) { Object value = getValue(extension.getAnyAttribute(), "effect", true); //$NON-NLS-1$ if (value instanceof String) { UMLUtil.setTaggedValue(action, getUML2Stereotype( action, STEREOTYPE__ACTION), TAG_DEFINITION__EFFECT, value); } } return super.caseAction(action); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ public static StrucDocText createStrucDocText(Section section, String xmlString) { StrucDocText text = null; try { Resource.Factory factory = new GenericXMLResourceFactoryImpl(); XMLResource resource = (XMLResource) factory.createResource(null); resource.load(new URIConverter.ReadableInputStream("<text>" + xmlString + "</text>"), null); XMLTypeDocumentRoot root = (XMLTypeDocumentRoot) resource.getContents().get(0); AnyType value = (AnyType) root.getMixed().getValue(0); text = CDAFactory.eINSTANCE.createStrucDocText(); text.getMixed().addAll(value.getMixed()); section.setText(text); } catch (Exception e) { } return text; }
protected EObject getEObject(AnyType extension, Resource resource, String name, boolean remove) { if (extension != null) { Object value = getValue(extension.getAnyAttribute(), name, remove); if (value == null) { value = getValue(extension.getMixed(), name, remove); if (value instanceof EObject) { return (EObject) value; } } else if (value instanceof String && resource != null) { return resource.getEObject((String) value); } } return null; }
@Override public Object casePackageableElement( PackageableElement packageableElement) { AnyType extension = getExtension(resource, packageableElement); if (extension != null) { Object value = getValue(extension.getAnyAttribute(), "packageableElement_visibility", true); //$NON-NLS-1$ if (value instanceof String) { packageableElement.setVisibility(VisibilityKind .get((String) value)); } } return super.casePackageableElement(packageableElement); }