コード例 #1
0
  /** @see org.teiid.designer.core.types.DatatypeManager#getUUID(org.eclipse.emf.ecore.EObject) */
  @Override
  public ObjectID getUuid(EObject type) {
    if (type instanceof XSDSimpleTypeDefinition) {
      XSDAnnotation annotation = ((XSDSimpleTypeDefinition) type).getAnnotation();
      if (annotation == null) {
        return null;
      }

      final Iterator appInfos = annotation.getApplicationInformation().iterator();
      while (appInfos.hasNext()) {
        final Element appInfo = (Element) appInfos.next();
        final String uuid = appInfo.getAttribute("UUID"); // $NON-NLS-1$
        if (uuid != null && uuid.trim().length() > 0) {
          try {
            return IDGenerator.getInstance().stringToObject(uuid);
          } catch (InvalidIDException e) {
            return null;
          }
        }

        return null;
      }
    }

    return null;
  }
コード例 #2
0
 protected int getID() {
   return idGenerator.nextInt();
 }