/**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public String convertComputedKeyOpenEnumToString(EDataType eDataType, Object instanceValue) {
   if (instanceValue == null) return null;
   if (_200512Package.Literals.COMPUTED_KEY_ENUM.isInstance(instanceValue)) {
     try {
       String value =
           convertComputedKeyEnumToString(
               _200512Package.Literals.COMPUTED_KEY_ENUM, instanceValue);
       if (value != null) return value;
     } catch (Exception e) {
       // Keep trying other member types until all have failed.
     }
   }
   if (XMLTypePackage.Literals.ANY_URI.isInstance(instanceValue)) {
     try {
       String value =
           XMLTypeFactory.eINSTANCE.convertToString(
               XMLTypePackage.Literals.ANY_URI, instanceValue);
       if (value != null) return value;
     } catch (Exception e) {
       // Keep trying other member types until all have failed.
     }
   }
   throw new IllegalArgumentException(
       "Invalid value: '" + instanceValue + "' for datatype :" + eDataType.getName());
 }
Ejemplo n.º 2
0
 /**
  * Validates the ItemType constraint of '<em>UR Is</em>'.
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public boolean validateURIs_ItemType(
     List<?> urIs, DiagnosticChain diagnostics, Map<Object, Object> context) {
   boolean result = true;
   for (Iterator<?> i = urIs.iterator(); i.hasNext() && (result || diagnostics != null); ) {
     Object item = i.next();
     if (XMLTypePackage.Literals.ANY_URI.isInstance(item)) {
       result &= xmlTypeValidator.validateAnyURI((String) item, diagnostics, context);
     } else {
       result = false;
       reportDataValueTypeViolation(XMLTypePackage.Literals.ANY_URI, item, diagnostics, context);
     }
   }
   return result;
 }
Ejemplo n.º 3
0
 /**
  * Validates the MemberTypes constraint of '<em>UR Ior Safe CURIE</em>'.
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public boolean validateURIorSafeCURIE_MemberTypes(
     String urIorSafeCURIE, DiagnosticChain diagnostics, Map<Object, Object> context) {
   if (diagnostics != null) {
     BasicDiagnostic tempDiagnostics = new BasicDiagnostic();
     if (XMLTypePackage.Literals.ANY_URI.isInstance(urIorSafeCURIE)) {
       if (xmlTypeValidator.validateAnyURI(urIorSafeCURIE, tempDiagnostics, context)) return true;
     }
     if (DatatypesPackage.Literals.SAFE_CURIE.isInstance(urIorSafeCURIE)) {
       if (validateSafeCURIE(urIorSafeCURIE, tempDiagnostics, context)) return true;
     }
     for (Diagnostic diagnostic : tempDiagnostics.getChildren()) {
       diagnostics.add(diagnostic);
     }
   } else {
     if (XMLTypePackage.Literals.ANY_URI.isInstance(urIorSafeCURIE)) {
       if (xmlTypeValidator.validateAnyURI(urIorSafeCURIE, null, context)) return true;
     }
     if (DatatypesPackage.Literals.SAFE_CURIE.isInstance(urIorSafeCURIE)) {
       if (validateSafeCURIE(urIorSafeCURIE, null, context)) return true;
     }
   }
   return false;
 }